function VPAHoly()
	if not IsAddOnLoaded("PQInterface") then
		if not VSIWarning then
			VAS_WriteToChat("\124cFFFF55FFWarning: only works with VSI addon!")
			VSIWarning = true
		end
		return true
	end

	if not PQI_General_Holy_Paladin_GUI_Loaded then
		local config = {
			name	= 'General Holy Paladin',
			author	= 'Vachiusa',
			abilities = {
				-- General --
				{	name = "Auto Open PQI Options",
					tooltip = "Auto Opens PQI Options for you, will only happen once per login.",
					enable = true,
				},
				{	name = "54 Events",
					tooltip = "Enables the use of 5.4 boss specific mechanics",
					enable = true,
				},				
				{	name = "53 Events",
					tooltip = "Enables the use of 5.3 boss specific mechanics",
					enable = false,
				},
				{ 	name = "4x Events",
					enable = false,
					tooltip = "Enables the use of 4.x boss specific mechanics",
				},
				{ 	name = "Special Events",
					enable = false,
					tooltip = "Enables the use of special events mechanics (Providing Ground...)",
				},	
				{ 	name = "Auto Event Dispel",
					enable = true,
					tooltip = "Enables the use of dispel on special events mechanics",
				},											
				{ 	name = "Queue Sys",
					enable = true,
					tooltip = "Enables the use of auto dispel for Queue System",
				},					
				{ 	name = "Auto Target",
					enable = true,
					tooltip = "If you dont have a target it will target your focus target",
				},
				{ 	name = "Lay On Hands For Mana",	
					enable = false,
					tooltip = "Enables the use of Lay On Hands For Mana",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of Mana to use Lay On Hands For Mana at",
					},
				},
				{ 	name = "Divine Plea",
					enable = true,
					tooltip = "Enables the use of Divine Plea",
					widget = { type = 'numBox',
						value = 80,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of Mana to use Divine Plea at",
					},
				},
				{ 	name = "Low Mana",	
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of Mana to not use some high mana skills at",
					},
				},				
				{ 	name = "DPS",
					enable = true,
					tooltip = "Enables DPS",
					widget = { type = 'numBox',
						value = 90,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of minimum raid members HP to DPS at",
					},
				},
				{ 	name = "Cleanse",
					enable = true,
					tooltip = "Enables the use of Cleanse",
					widget = { type = 'numBox',
						value = 50,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Cleanse at",
					},
				},
				{ 	name = "Racials",
					enable = true,
					tooltip = "Enables the use of Racials",
				},								
				{ 	name = "Target Heal",
					enable = false,
					tooltip = "Enables the use of Target Heal priority",
				},											
				{ 	name = "Mouseover Heal",
					enable = false,
					tooltip = "Enables the use of Mouseover Heal priority",
				},	
				{ 	name = "NPC Mouseover Heal",
					enable = false,
					tooltip = "Enables the use of NPC Mouseover Heal priority",
				},		
				{ 	name = "Pet Heal",
					enable = true,
					tooltip = "Enables the use of Pet Heal",
				},			
				{ 	name = "Stop Casting",
					enable = false,
					tooltip = "Enables the use of Stop Casting",
				},							
				{ 	name = "V debug",
					enable = false,
					tooltip = "Enables the use of Vachiusa debug",
				},							
			},
			hotkeys = {
			},
		}
		PQI_General_Holy_Paladin_GUI_Loaded = PQI:AddRotation(config)
	end

	if not PQI_CD_Holy_Paladin_GUI_Loaded then
		local config = {
			name	= 'CD Holy Paladin',
			author	= 'Vachiusa',
			abilities = {									
				-- CD's --			
				{ 	name = "Lay On Hands",
					enable = true,
					tooltip = "Enables the use of Lay On Hands",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Lay On Hands at",
					},
				},	
				{ 	name = "Beacon Of Light",
					enable = true,
					tooltip = "Enables the use of Beacon Of Light",
					widget = { type = 'numBox',
						value = 30,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Beacon Of Light at",
					},
				},		
				{ 	name = "Beacon Of Light Tanks Only",
					enable = false,
					tooltip = "Enables the auto use of Beacon Of Light on Tanks only",
				},	
				{ 	name = "Crusader Strike On CD",
					enable = true,
					tooltip = "Enables the auto use of Crusader Strike on cooldown",
				},				
				{ 	name = "Judgment",
					enable = true,
					tooltip = "Enables the auto use of Judgment (talent Selfless Healer)",
				},																					
				{ 	name = "Guardian Of Ancient Kings",
					enable = true,
					tooltip = "Enables the use of Guardian Of Ancient Kings",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Guardian Of Ancient Kings at",
					},
				},	
				{ 	name = "Hand Of Protection",
					enable = true,
					tooltip = "Enables the use of Hand Of Protection",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of target HP to use Hand Of Protection at",
					},
				},	
				{ 	name = "Hand Of Sacrifice",
					enable = true,
					tooltip = "Enables the use of Hand Of Sacrifice",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of target HP to use Hand Of Sacrifice at",
					},
				},	
				{ 	name = "Hand Of Salvation",
					enable = true,
					tooltip = "Enables the use of Hand Of Salvation",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of target HP to use Hand Of Salvation at",
					},
				},									
				{ 	name = "Auto Avenging Wrath",
					enable = true,
					tooltip = "Enables the auto use of Avenging Wrath",
				},					
				{ 	name = "Auto Devotion Aura",
					enable = true,
					tooltip = "Enables the auto use of Devotion Aura",
				},						
				{ 	name = "Auto Holy Avenger",
					enable = true,
					tooltip = "Enables the auto use of Holy Avenger",
				},												
			},
			hotkeys = {
			},
		}
		PQI_CD_Holy_Paladin_GUI_Loaded = PQI:AddRotation(config)
	end

	if not PQI_Healing_Holy_Paladin_GUI_Loaded then
		local config = {
			name	= 'Healing Holy Paladin',
			author	= 'Vachiusa',
			abilities = {												
				-- Healing --
				{ 	name = "Divine Light",
					enable = true,
					tooltip = "Enables the use of Divine Light",
					widget = { type = 'numBox',
						value = 60,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Divine Light at",
					},
				},
				{ 	name = "Word Of Glory",
					enable = true,
					tooltip = "Enables the use of Word Of Glory",
					widget = { type = 'numBox',
						value = 90,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Word Of Glory at",
					},
				},
				{ 	name = "Word Of Glory Holy Power",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 1,
						step = 1,
						max = 4,
						min = 1,
						tooltip = "Caution: change this value may break my healing logic. The number of holy power to use Word Of Glory or Eternal Flame at",
					},
				},
				{ 	name = "Eternal Flame Buff Spam",
					enable = true,
					tooltip = "Enables the use of Eternal Flame Buff Spam",
				},	
				{ 	name = "EF Spam Holy Power",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 5,
						min = 1,
						tooltip = "Caution: change this value may break my healing logic. The number of holy power to use Eternal Flame Buff Spam at",
					},
				},	
				{ 	name = "Holy Shock Healing Spam",
					enable = true,
					tooltip = "Enables the use of Holy Shock Healing Spam",
				},																
				{ 	name = "Holy Light",
					enable = true,
					tooltip = "Enables the use of Holy Light",
					widget = { type = 'numBox',
						value = 80,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Holy Light at",
					},
				},	
				{ 	name = "Flash Of Light",
					enable = true,
					tooltip = "Enables the use of Flash Of Light",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Flash Of Light at",
					},
				},	
				{ 	name = "Flash Of Light Tank",
					enable = true,
					tooltip = "Enables the use of Flash Of Light on Tanks",
					widget = { type = 'numBox',
						value = 30,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Flash Of Light on Tanks at",
					},
				},							
				{ 	name = "Sacred Shield",
					enable = true,
					tooltip = "Enables the use of Sacred Shield",
					widget = { type = 'numBox',
						value = 30,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Sacred Shield at",
					},
				},						
				{ 	name = "Holy Shock AOE",
					enable = true,
					tooltip = "Enables the use of Holy Shock AOE",
					widget = { type = 'numBox',
						value = 100,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Holy Shock AOE at",
					},
				},
				{ 	name = "Holy Shock AOE Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 1,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of raid members around healing target to use Holy Shock AOE at",
					},
				},
				{ 	name = "Holy Radiance",
					enable = true,
					tooltip = "Enables the use of Holy Radiance",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to auto use Holy Radiance at",
					},
				},
				{ 	name = "Holy Radiance Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 2,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of low HP raid members to use Holy Radiance at",
					},
				},				
				{ 	name = "Light Of Dawn",
					enable = true,
					tooltip = "Enables the use of Light Of Dawn",
					widget = { type = 'numBox',
						value = 90,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Light Of Dawn at",
					},
				},
				{ 	name = "Light Of Dawn Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 20,
						min = 0,
						tooltip = "The number of raid members around healing target to use Light Of Dawn at",
					},
				},
				{ 	name = "Light Of Dawn Spam",
					enable = false,
					tooltip = "Enables the use of Eternal Flame Buff Spam",
				},					
				{ 	name = "Divine Favor",
					enable = true,
					tooltip = "Enables the use of Divine Favor",
					widget = { type = 'numBox',
						value = 70,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Divine Favor at",
					},
				},
				{ 	name = "Divine Favor Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of raid members around healing target to use Divine Favor at",
					},
				},							
				{ 	name = "Talent 90",
					enable = true,
					tooltip = "Enables the use of Talent 90",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Holy Prism at",
					},
				},
				{ 	name = "Talent 90 Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of raid members around healing target to use Talent 90 at",
					},
				},													
			},
			hotkeys = {
				{	name = "Pause Rotation",		enable = true,	hotkeys = {'ls'},	},
				{	name = "Avenging Wrath",			enable = true,	hotkeys = {'rs'},	
					tooltip = "Pop Avenging Wrath or Holy Avenger", },
				{	name = "Talent 90",		enable = true,	hotkeys = {'lc'},
					tooltip = "Pop Talent 90", },
				{	name = "Divine Favor",			enable = true,	hotkeys = {'ra'},	
					tooltip = "Pop Divine Favor", },
				{	name = "Devotion Aura",		enable = true,	hotkeys = {'rc'},	
					tooltip = "Pop Devotion Aura", },	
				{	name	= "Adding Players CT",		enable	= true,	hotkeys	= {'ls', 'la'},
					tooltip = "Adding Players to Custom Table", },	
				{	name	= "Removing Players CT",		enable	= true,	hotkeys	= {'ls', 'lc'},
					tooltip = "Removing Players from Custom Table", },						
			},
		}
		PQI_Healing_Holy_Paladin_GUI_Loaded = PQI:AddRotation(config)
	end
	if VaSpec ~= 65 then
		VaSpec = 65
		PQR_RotationChanged("Vachiusa Holy Paladin")
	end

	-- Variables
	if PQI_General_Holy_Paladin_GUI_Loaded and PQI_CD_Holy_Paladin_GUI_Loaded and PQI_Healing_Holy_Paladin_GUI_Loaded then
		
		PQI_Variables_Loaded = PQI_VachiusaGeneralHolyPaladin_AutoOpenPQIOptions_enable
		VachiusaHolyPaladin_AutoOpenPQIOptions_enable = PQI_VachiusaGeneralHolyPaladin_AutoOpenPQIOptions_enable

		Vasa_DivineLightCheck = PQI_VachiusaHealingHolyPaladin_DivineLight_enable
		Vasa_DivineLight = PQI_VachiusaHealingHolyPaladin_DivineLight_value
		Vasa_WordOfGloryCheck = PQI_VachiusaHealingHolyPaladin_WordOfGlory_enable
		Vasa_WordOfGlory = PQI_VachiusaHealingHolyPaladin_WordOfGlory_value
		Vasa_WordOfGloryHolyPowerCheck = PQI_VachiusaHealingHolyPaladin_WordOfGloryHolyPower_enable
		Vasa_WordOfGloryHolyPower = PQI_VachiusaHealingHolyPaladin_WordOfGloryHolyPower_value
		Vasa_EternalFlameBuffSpamCheck = PQI_VachiusaHealingHolyPaladin_EternalFlameBuffSpam_enable
		Vasa_EFSpamHolyPower = PQI_VachiusaHealingHolyPaladin_EFSpamHolyPower_value
		Vasa_HolyShockHealingSpamCheck = PQI_VachiusaHealingHolyPaladin_HolyShockHealingSpam_enable	
		Vasa_HolyLightCheck = PQI_VachiusaHealingHolyPaladin_HolyLight_enable
		Vasa_HolyLight = PQI_VachiusaHealingHolyPaladin_HolyLight_value
		Vasa_FlashOfLightCheck = PQI_VachiusaHealingHolyPaladin_FlashOfLight_enable
		Vasa_FlashOfLight = PQI_VachiusaHealingHolyPaladin_FlashOfLight_value
		Vasa_FlashOfLightTankCheck = PQI_VachiusaHealingHolyPaladin_FlashOfLightTank_enable
		Vasa_FlashOfLightTank = PQI_VachiusaHealingHolyPaladin_FlashOfLightTank_value	
		Vasa_SacredShieldCheck = PQI_VachiusaHealingHolyPaladin_SacredShield_enable
		Vasa_SacredShield = PQI_VachiusaHealingHolyPaladin_SacredShield_value
		Vasa_HolyShockAOECheck = PQI_VachiusaHealingHolyPaladin_HolyShockAOE_enable
		Vasa_HolyShockAOE = PQI_VachiusaHealingHolyPaladin_HolyShockAOE_value
		Vasa_HolyShockAOELimitCheck = PQI_VachiusaHealingHolyPaladin_HolyShockAOELimit_enable
		Vasa_HolyShockAOELimit = PQI_VachiusaHealingHolyPaladin_HolyShockAOELimit_value	
		Vasa_HolyRadianceCheck = PQI_VachiusaHealingHolyPaladin_HolyRadiance_enable
		Vasa_HolyRadiance = PQI_VachiusaHealingHolyPaladin_HolyRadiance_value
		Vasa_HolyRadianceLimitCheck = PQI_VachiusaHealingHolyPaladin_HolyRadianceLimit_enable
		Vasa_HolyRadianceLimit = PQI_VachiusaHealingHolyPaladin_HolyRadianceLimit_value
		Vasa_LightOfDawnCheck = PQI_VachiusaHealingHolyPaladin_LightOfDawn_enable
		Vasa_LightOfDawn = PQI_VachiusaHealingHolyPaladin_LightOfDawn_value
		Vasa_LightOfDawnLimitCheck = PQI_VachiusaHealingHolyPaladin_LightOfDawnLimit_enable
		Vasa_LightOfDawnLimit = PQI_VachiusaHealingHolyPaladin_LightOfDawnLimit_value
		Vasa_LightOfDawnSpamCheck = PQI_VachiusaHealingHolyPaladin_LightOfDawnSpam_enable	
		Vasa_DivineFavorCheck = PQI_VachiusaHealingHolyPaladin_DivineFavor_enable
		Vasa_DivineFavor = PQI_VachiusaHealingHolyPaladin_DivineFavor_value
		Vasa_DivineFavorLimitCheck = PQI_VachiusaHealingHolyPaladin_DivineFavorLimit_enable
		Vasa_DivineFavorLimit = PQI_VachiusaHealingHolyPaladin_DivineFavorLimit_value	
		Vasa_Talent90Check = PQI_VachiusaHealingHolyPaladin_Talent90_enable
		Vasa_Talent90 = PQI_VachiusaHealingHolyPaladin_Talent90_value
		Vasa_Talent90LimitCheck = PQI_VachiusaHealingHolyPaladin_Talent90Limit_enable
		Vasa_Talent90Limit = PQI_VachiusaHealingHolyPaladin_Talent90Limit_value
		Vasa_DivineFavorAutoCheck = PQI_VachiusaHealingHolyPaladin_DivineFavor_enable
		Vasa_Talent90AutoCheck = PQI_VachiusaHealingHolyPaladin_Talent90_enable
				
		Vasa_LayOnHandsCheck = PQI_VachiusaCDHolyPaladin_LayOnHands_enable
		Vasa_LayOnHands = PQI_VachiusaCDHolyPaladin_LayOnHands_value
		Vasa_BeaconOfLightCheck = PQI_VachiusaCDHolyPaladin_BeaconOfLight_enable
		Vasa_BeaconOfLight = PQI_VachiusaCDHolyPaladin_BeaconOfLight_value
		Vasa_BeaconOfLightTanksOnlyCheck = PQI_VachiusaCDHolyPaladin_BeaconOfLightTanksOnly_enable
		Vasa_BeaconOfLightTanksOnly = PQI_VachiusaCDHolyPaladin_BeaconOfLightTanksOnly_value
		Vasa_CrusaderStrikeOnCDCheck = PQI_VachiusaCDHolyPaladin_CrusaderStrikeOnCD_enable
		Vasa_CrusaderStrikeOnCD = PQI_VachiusaCDHolyPaladin_CrusaderStrikeOnCD_value
		Vasa_JudgmentCheck = PQI_VachiusaCDHolyPaladin_Judgment_enable
		Vasa_Judgment = PQI_VachiusaCDHolyPaladin_Judgment_value
		Vasa_GuardianOfAncientKingsCheck = PQI_VachiusaCDHolyPaladin_GuardianOfAncientKings_enable
		Vasa_GuardianOfAncientKings = PQI_VachiusaCDHolyPaladin_GuardianOfAncientKings_value
		Vasa_HandOfProtectionCheck = PQI_VachiusaCDHolyPaladin_HandOfProtection_enable
		Vasa_HandOfProtection = PQI_VachiusaCDHolyPaladin_HandOfProtection_value
		Vasa_HandOfSacrificeCheck = PQI_VachiusaCDHolyPaladin_HandOfSacrifice_enable
		Vasa_HandOfSacrifice = PQI_VachiusaCDHolyPaladin_HandOfSacrifice_value
		Vasa_HandOfSalvationCheck = PQI_VachiusaCDHolyPaladin_HandOfSalvation_enable
		Vasa_HandOfSalvation = PQI_VachiusaCDHolyPaladin_HandOfSalvation_value
		Vasa_AvengingWrathAutoCheck = PQI_VachiusaCDHolyPaladin_AutoAvengingWrath_enable
		Vasa_AvengingWrathAuto = PQI_VachiusaCDHolyPaladin_AutoAvengingWrath_value
		Vasa_DevotionAuraAutoCheck = PQI_VachiusaCDHolyPaladin_AutoDevotionAura_enable
		Vasa_DevotionAuraAuto = PQI_VachiusaCDHolyPaladin_AutoDevotionAura_value	
		Vasa_HolyAvengerAutoCheck = PQI_VachiusaCDHolyPaladin_AutoHolyAvenger_enable
		Vasa_HolyAvengerAuto = PQI_VachiusaCDHolyPaladin_AutoHolyAvenger_value		
		
		Vasa_AutoTargetCheck = PQI_VachiusaGeneralHolyPaladin_AutoTarget_enable
		Vasa_AutoTarget = PQI_VachiusaGeneralHolyPaladin_AutoTarget_value
		Vasa_ManaLayOnHandsCheck = PQI_VachiusaGeneralHolyPaladin_LayOnHandsForMana_enable
		Vasa_ManaLayOnHands = PQI_VachiusaGeneralHolyPaladin_LayOnHandsForMana_value
		Vasa_DivinePleaCheck = PQI_VachiusaGeneralHolyPaladin_DivinePlea_enable
		Vasa_DivinePlea = PQI_VachiusaGeneralHolyPaladin_DivinePlea_value
		Vasa_LowManaCheck = PQI_VachiusaGeneralHolyPaladin_LowMana_enable
		Vasa_LowMana = PQI_VachiusaGeneralHolyPaladin_LowMana_value	
		Vasa_DPSCheck = PQI_VachiusaGeneralHolyPaladin_DPS_enable
		Vasa_DPS = PQI_VachiusaGeneralHolyPaladin_DPS_value
		Vasa_CleanseCheck = PQI_VachiusaGeneralHolyPaladin_Cleanse_enable
		Vasa_Cleanse = PQI_VachiusaGeneralHolyPaladin_Cleanse_value
		Vasa_RacialsCheck = PQI_VachiusaGeneralHolyPaladin_Racials_enable
		Vasa_Racials = PQI_VachiusaGeneralHolyPaladin_Racials_value
		Vasa_4xEventsCheck = PQI_VachiusaGeneralHolyPaladin_4xEvents_enable
		Vasa_4xEvents = PQI_VachiusaGeneralHolyPaladin_4xEvents_value
		Vasa_53EventsCheck = PQI_VachiusaGeneralHolyPaladin_53Events_enable
		Vasa_53Events = PQI_VachiusaGeneralHolyPaladin_53Events_value
		Vasa_54EventsCheck = PQI_VachiusaGeneralHolyPaladin_54Events_enable
		Vasa_54Events = PQI_VachiusaGeneralHolyPaladin_54Events_value	
		Vasa_SpecialEvents = PQI_VachiusaGeneralHolyPaladin_SpecialEvents_enable	
		Vasa_AutoEventDispel = PQI_VachiusaGeneralHolyPaladin_AutoEventDispel_enable	
		Vasa_QueueSysCheck = PQI_VachiusaGeneralHolyPaladin_QueueSys_enable
		Vasa_QueueSys = PQI_VachiusaGeneralHolyPaladin_QueueSys_value	
		Vasa_Mouseover = PQI_VachiusaGeneralHolyPaladin_MouseoverHeal_enable
		Vasa_TargetHeal = PQI_VachiusaGeneralHolyPaladin_TargetHeal_enable
		Vasa_NPCMouseoverHeal = PQI_VachiusaGeneralHolyPaladin_NPCMouseoverHeal_enable
		Vasa_PetHeal = PQI_VachiusaGeneralHolyPaladin_PetHeal_enable
		Vasa_StopCasting = PQI_VachiusaGeneralHolyPaladin_StopCasting_enable
		Vdebug = PQI_VachiusaGeneralHolyPaladin_Vdebug_enable	

		
		if Vasa_LowHP == nil then Vasa_LowHP = 80 end
		if Vasa_ActualHP == nil or Vasa_ActualHP then Vasa_ActualHP = false end
		
		-- Hotkeys
		if not PQI_Hotkeys_Functions_Set then
			function PQI_PauseRotation()
				if PQI_VachiusaHealingHolyPaladin_PauseRotation_enable and PQI:IsHotkeys(PQI_VachiusaHealingHolyPaladin_PauseRotation_key) then
				return true else return false 
			end	end
			function PQI_AvengingWrath()
				if PQI_VachiusaHealingHolyPaladin_AvengingWrath_enable and PQI:IsHotkeys(PQI_VachiusaHealingHolyPaladin_AvengingWrath_key) then
				return true else return false
			end	end		
			function PQI_Talent90()
				if PQI_VachiusaHealingHolyPaladin_Talent90_enable and PQI:IsHotkeys(PQI_VachiusaHealingHolyPaladin_Talent90_key) then
				return true else return false
			end	end			
			function PQI_DivineFavor()
				if PQI_VachiusaHealingHolyPaladin_DivineFavor_enable and PQI:IsHotkeys(PQI_VachiusaHealingHolyPaladin_DivineFavor_key) then
				return true else return false
			end	end	
			function PQI_DevotionAura()
				if PQI_VachiusaHealingHolyPaladin_DevotionAura_enable and PQI:IsHotkeys(PQI_VachiusaHealingHolyPaladin_DevotionAura_key) then
				return true else return false
			end	end		
			function PQI_AddingPlayersCT()
				if PQI_VachiusaHealingHolyPaladin_AddingPlayersCT_enable and PQI:IsHotkeys(PQI_VachiusaHealingHolyPaladin_AddingPlayersCT_key) then
				return true else return false
			end	end	
			function PQI_RemovingPlayersCT()
				if PQI_VachiusaHealingHolyPaladin_RemovingPlayersCT_enable and PQI:IsHotkeys(PQI_VachiusaHealingHolyPaladin_RemovingPlayersCT_key) then
				return true else return false
			end	end			
		end	
		
		Vasa_PauseRotationCheck = PQI_VachiusaHealingHolyPaladin_PauseRotation_enable
		Vasa_MAvengingWrathCheck = PQI_VachiusaHealingHolyPaladin_AvengingWrath_enable
		Vasa_Talent90ModCheck = PQI_VachiusaHealingHolyPaladin_Talent90_enable
		Vasa_MDivineFavorCheck = PQI_VachiusaHealingHolyPaladin_DivineFavor_enable
		Vasa_MDevotionAuraCheck = PQI_VachiusaHealingHolyPaladin_DevotionAura_enable	
		Vasa_AddingPlayersCTCheck = PQI_VachiusaHealingHolyPaladin_AddingPlayersCT_enable
		Vasa_RemovingPlayersCTCheck = PQI_VachiusaHealingHolyPaladin_RemovingPlayersCT_enable
		
		VachiusaHolyPaladin_PauseRotation_key = PQI_PauseRotation()
		VachiusaHolyPaladin_AvengingWrath_key = PQI_AvengingWrath()
		VachiusaHolyPaladin_Talent90_key = PQI_Talent90()
		VachiusaHolyPaladin_DivineFavor_key = PQI_DivineFavor()
		VachiusaHolyPaladin_DevotionAura_key = PQI_DevotionAura()
		VachiusaHolyPaladin_AddingPlayersCT_key = PQI_AddingPlayersCT()
		VachiusaHolyPaladin_RemovingPlayersCT_key = PQI_RemovingPlayersCT()	

		--Set PQI
		if not PQI_VachiusaHolyPaladin_Set and VachiusaHolyPaladin_AutoOpenPQIOptions_enable ~= nil then
			VAS_RunMacroText("/PQI show")
			VAS_RunMacroText("/PQI config show")
			VAS_RunMacroText("/PQI config width 220")
			if not VachiusaHolyPaladin_AutoOpenPQIOptions_enable then VAS_RunMacroText("/PQI config hide") end
			PQI_VachiusaHolyPaladin_Set = true
		end
	end

	
	if PQI_Variables_Loaded == nil then
		if not VSIWarning2 then
			VAS_WriteToChat("\124cFFFF55FFWarning: something wrong with VSI addon!")
			VSIWarning2 = true
		end
		return true
	end

	if not VAS_RotationStarted then
		if UnitLevel("player") ~= 90 then
			VAS_WriteToChat("\124cFFFF55FFWarning: only takes full effect when we're 90!")	
			return true --added
		end	
		QueueSystem()
		VAS_RotationStarted = true
	end

	if VAS_Moving("player") then
		Vasa_Moving = true
	else
		Vasa_Moving = false
	end

	--------------------------------------
	-- Adding Players to Custom Table
	--------------------------------------
	if Vasa_AddingPlayersCTCheck then
		if VachiusaHolyPaladin_AddingPlayersCT_key
		and not GetCurrentKeyBoardFocus()
		and UnitExists("mouseover")
		and ( CanHeal("mouseover") 
		or UnitIsUnit("player", "mouseover") ) then  
			for i=1, #Vasa_CustomT do
				if Vasa_CustomT[i].GUID and Vasa_CustomT[i].GUID == UnitGUID("mouseover") then
					return false
				end
			end
			
			table.insert(Vasa_CustomT, { GUID = UnitGUID("mouseover") } )
			
			if not GetCVarBool("Vasa_Recording") then
				VAS_WriteToChat("We just added "..UnitName("mouseover").." to the Custom Healing Table.", "Alert")
			end
			return true
		
		end
	end

	--------------------------------------
	-- Removing Players from Custom Table
	--------------------------------------
	if Vasa_RemovingPlayersCTCheck then
		if VachiusaHolyPaladin_RemovingPlayersCT_key
		and not GetCurrentKeyBoardFocus() 
		and UnitExists("mouseover")
		and ( CanHeal("mouseover") 
		or UnitIsUnit("player", "mouseover") )then
			for i=1, #Vasa_CustomT do
				if Vasa_CustomT[i].GUID and Vasa_CustomT[i].GUID == UnitGUID("mouseover") then
					if not GetCVarBool("Vasa_Recording") then
						VAS_WriteToChat("We just removed "..UnitName(Vasa_CustomT[i].Unit).." from the Custom Healing Table.", "Alert")
					end
					table.remove(Vasa_CustomT, i)
					return true
				end
			end
		end
	end

	if (VachiusaHolyPaladin_PauseRotation_key and not GetCurrentKeyBoardFocus())
	 or UnitIsDeadOrGhost("player") 
	 or IsMounted()
	 or UnitBuffID("player", 104269) then --drink
		if PQI_VachiusaGeneral_RotationEngine_value == 4 then
			raidfu = nil
			vicon = nil
			CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", VAS_UpdateIcon)
		elseif PQI_VachiusaGeneral_RotationEngine_value == 7 and not UnitCastingInfo("player") then
			raidfu = nil
			vicon = nil
			HealBot_OnEvent_VachiusaUpdate(vicon,raidfu)
		elseif PQI_VachiusaGeneral_RotationEngine_value == 8 and not UnitCastingInfo("player") then
			raidfu = nil
			vicon = nil
			ElvUF_OnEvent_VachiusaUpdate(vicon,raidfu)
		end
		return true
	end

	-- Healing Engine --
	if Vasa_54EventsCheck then
		if not UnitDebuffID("player",144850) --Test of Reliance
		and not UnitDebuffID("player",142861) then --Ancient Miasma
			SheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_SpecialEvents, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true
		end
	else
		SheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_SpecialEvents, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true	
	end

	if GetCVarBool("PQ_UseCustomT") then
		members = Vasa_CustomT
		lowhpmembers = 0
		for i=1, #Vasa_CustomT do
			if Vasa_CustomT[i].HP < 80 then
				lowhpmembers = lowhpmembers + 1
			end
		end
		
		table.sort(members, function(x,y) return x.HP < y.HP end)
	end

	if UnitAffectingCombat("player") then
		if GetItemCount(5512,false,true) > 0
		and Vasa_UnitInfo("player") <= 20	
		and VAS_SpellAvailable(5512) --Healthstone		
		and GetItemCooldown(5512) == 0 then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end		
			VAS_UseItemByName(5512)
			--VAS_WriteToChat("\124cFFFF55FFHealthstone - HP: " ..Vasa_UnitInfo("player")) 
			return true
		--elseif GetInventoryItemCooldown("player", 6)==0 --Grounded Plasma Shield 	
		--then 
			--VAS_UseInventoryItem(6) 
			--return true
		--The next 3 attacks within 45 sec that deal damage equal to 20% or more of your total health are reduced in half.
		elseif VAS_SpellAvailable(498)	
		and not UnitBuffID("player",642) --Divine Shield
		and (UnitBuffID("player",6940) --Hand of Sacrifice
		or Vasa_UnitInfo("player") <= 20)
		--and select(2,GetSpellCooldown(498)) < 2 
		then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end		
			VAS_Cast(498,nil)	 			
			--VAS_WriteToChat("\124cFFFF55FFDivine Protection - My HP: "..Vasa_UnitInfo("player"))		
			return true		
		elseif VAS_SpellAvailable(642) 
		and Vasa_UnitInfo("player") <= 20	
		and IsUsableSpell(642) 
		and not UnitBuffID("player",498) --Divine Protection
		--and select(2,GetSpellCooldown(642)) < 2 
		then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end		
			VAS_Cast(642,nil)	 	
			--VAS_WriteToChat("\124cFFFF55FFDivine Shield - My HP: "..Vasa_UnitInfo("player"))	
			return true		
		end
	end

	if Vasa_RacialsCheck
	and UnitAffectingCombat("player") then

		local PQ_Class = select(2, UnitClass("player")) 
		
		--Draenei 
		local GiftOfTheNaaru = 59542	
		--Blood Elf
		local ArcaneTorrent = 28730 --mana regen
		
		if PQ_Class == "PALADIN" then
			GiftOfTheNaaru = 59542	
		elseif PQ_Class == "MONK" then 
			GiftOfTheNaaru = 121093
			ArcaneTorrent = 129597 --chi regen
		elseif PQ_Class == "PRIEST" then  
			GiftOfTheNaaru = 59544
		elseif PQ_Class == "SHAMAN" then 
			GiftOfTheNaaru = 59547
		end

		--Troll 
		local Berserking = 26297 
		--Undead
		local WillOfTheForsaken = 7744  
		--Dwarven 
		local Stoneform = 20594 
		--Human 
		local EveryManForHimself = 59752
		--Undead 
		--local Cannibalize = 20577 --not much helpful
		--Orc 
		local BloodFury = 33702
		--Gloves Engineer
		local _, GECooldown, GEReady = GetInventoryItemCooldown("player", 10)
				
		--HP
		if IsSpellKnown(GiftOfTheNaaru) 
		--and GetSpellCooldown(GiftOfTheNaaru) == 0 
		and VAS_SpellAvailable(GiftOfTheNaaru)
		and Vasa_UnitInfo("player") <= 30	
		then		
			VAS_Cast(GiftOfTheNaaru,nil)	 
			return true 
		end
		
		--Mana
		if IsSpellKnown(ArcaneTorrent) 
		and PQ_Class ~= "MONK"
		--and GetSpellCooldown(ArcaneTorrent) == 0 
		and VAS_SpellAvailable(ArcaneTorrent)
		and select(3, Vasa_UnitInfo("player")) <= 80	
		then		
			VAS_Cast(ArcaneTorrent,nil)	 
			return true 
		end	
		
		--CDs
		if not racialcds then
			function racialcds()
				if IsSpellKnown(BloodFury) 
				--and GetSpellCooldown(BloodFury) == 0 
				and VAS_SpellAvailable(BloodFury)	
				then		
					VAS_Cast(BloodFury,nil)	 
					return true 
				elseif IsSpellKnown(Berserking) 
				--and GetSpellCooldown(Berserking) == 0 
				and VAS_SpellAvailable(Berserking)	
				then		
					VAS_Cast(Berserking,nil)	 
					return true 
				elseif GECooldown == 0 
				and GEReady == 1 then
					VAS_UseInventoryItem(10)
				end
			end
		end
		
		if lowhpmembers >=5 then
			racialcds()
		end
		
		--Removes any Charm, Fear and Sleep effect
		if not GotFear then
			function GotFear(t) 
				local debuff = { 10326, 8122, 2094, 5782, 5484, 6358, 5246 }
				for i=1, #debuff do if UnitDebuffID(t,debuff[i]) then return true end end
			end
		end
		if IsSpellKnown(WillOfTheForsaken) 
		--and GetSpellCooldown(WillOfTheForsaken) == 0 
		and VAS_SpellAvailable(WillOfTheForsaken)	
		and GotFear("player")
		then		
			VAS_Cast(WillOfTheForsaken,nil)	 
			return true 
		end  
		
		--Removes all poison, disease and bleed effects and reduces all damage taken by 10% for 8 sec
		if not GotPoison then
			function GotPoison(t)
				local i, debuff = 1, select(5,UnitDebuff(t, 1)) 
				while debuff do
					if debuff == "Poison" or debuff == "Disease" then return true end
					i = i + 1 debuff = select(5,UnitDebuff(t, i)) 
				end
			end
		end	
		if IsSpellKnown(Stoneform) 
		--and GetSpellCooldown(Stoneform) == 0 
		and VAS_SpellAvailable(Stoneform)	
		and GotPoison("player")
		then		
			VAS_Cast(Stoneform,nil)	 
			return true 
		end    	
		
		--Removes all movement impairing effects and all effects which cause loss of control of your character
		if not LostControl then
			function LostControl(t) 
				local debuff = { 122, 10326, 8122, 2094, 5782, 5484, 6358, 5246, 408 }
				for i=1, #debuff do if UnitDebuffID(t,debuff[i]) then return true end end
			end
		end  
		if IsSpellKnown(EveryManForHimself) 
		--and GetSpellCooldown(EveryManForHimself) == 0 
		and VAS_SpellAvailable(EveryManForHimself)	
		and LostControl("player")
		then		
			VAS_Cast(EveryManForHimself,nil)	 
			return true 
		end		
	end

	if Vasa_54EventsCheck 
	and UnitAffectingCombat("player") then
		local boss,bossid = bossid()
		local dispelid = 4987	
		local rangecheckid = 635	
		local buff = { }
		stopcasting = false
		stopfade = false
		stopdps = false
		LLdebuff = false
		LLdebuffunit = false	
		if UnitExists(boss) then
			--local _, _, rdifficulty = GetInstanceInfo()
			if bossid == 71515 then --General Nazgrim
				if UnitBuffID("boss1", 143593) then --Defensive Stance
					stopdps = true				
				else
					stopdps = false
				end
			elseif bossid == 71995 or bossid == 71996 or bossid == 72000 then --Amalgam of Corruption - Norushen
				if UnitDebuffID("player",144850) --Test of Reliance
				then 
					BossSheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, 3, true, rangecheckid)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true
					local buff  = { 144514 } --Lingering Corruption
					RaidDispel(dispelid,buff) 	
				end
			elseif bossid == 71475 or bossid == 71479 or bossid == 71480 then --The Fallen Protectors
				local buff  = { 143434 } --Shadow Word: Bane
				RaidDispel(dispelid,buff) 	
			elseif bossid == 71734 then --Sha of Pride
				if UnitDebuffID("player",144359) then
					local buff  = { 144351 } --Mark of Arrogance
					RaidDispel(dispelid,buff) 			
				end
			elseif bossid == 71454 then --Malkorok	
				local buff  = { 142913 } 	
				RaidRangeDispel(dispelid,buff,8) 	
				if UnitDebuffID("player",142861) then --Ancient Miasma			
					ShieldSheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true					
				end
			elseif bossid == 71161 and PQI_VachiusaGeneral_RotationEngine_value ~= 4 and PQI_VachiusaGeneral_RotationEngine_value ~= 7 and PQI_VachiusaGeneral_RotationEngine_value ~= 8 then --Kil'ruk the Wind-Reaver - Paragons of the Klaxxi
				if UnitDebuffID("player",141858) then --Ingenious			
					if not tIngenious or (#tIngenious > 0 and (GetTime() > tIngenious[1].Time + 30)) then
						tIngenious = { }						
						local qTime = GetTime() 
						local lastmax = 0
						local maxunit = "player"		
						local lasttype = "notype"						
						local ClassList = { {'WARRIOR', 0 }, {'PALADIN', 0 }, {'HUNTER', 0 }, {'ROGUE', 0 }, {'PRIEST', 0 }, {'DEATHKNIGHT', 0 }, {'SHAMAN', 0 }, {'MAGE', 0 }, {'WARLOCK', 0 }, {'MONK', 0 }, {'DRUID', 0 } }				
						local RaceList = { {'Draenei', 0 }, {'Gnome', 0 }, {'Human', 0 }, {'NightElf', 0 }, {'Worgen', 0 }, {'Pandaren', 0 }, {'BloodElf', 0 }, {'Goblin', 0 }, {'Orc', 0 }, {'Tauren', 0 }, {'Troll', 0 }, {'Scourge', 0 } }
						for i=1,25 do
							local unitCheck = "raid"..i
						    if UnitExists(unitCheck) and UnitIsPlayer(unitCheck) then
							local _, unitClass = UnitClass(unitCheck)				    	
							local _, unitRace = UnitRace(unitCheck)				    	
							if unitClass and UnitRace then	
									--Class
									for j=1, #ClassList do
										if unitClass == ClassList[j][1] then
											--VAS_WriteToChat("Debug1 - Num: " ..ClassList[j][2].." - Class: " ..ClassList[j][1])
											ClassList[j][2] = ClassList[j][2] + 1
											if ClassList[j][2] > lastmax then
												lastmax = ClassList[j][2]
												maxunit = unitCheck
												lasttype = ClassList[j][1]
											end												
										end		
									end
									--Race
									for j=1, #RaceList do
										if unitRace == RaceList[j][1] then
											--VAS_WriteToChat("Debug1 - Num: " ..RaceList[j][2].." - Race: " ..RaceList[j][1])
											RaceList[j][2] = RaceList[j][2] + 1
											if RaceList[j][2] > lastmax then
												lastmax = RaceList[j][2]
												maxunit = unitCheck
												lasttype = RaceList[j][1]
											end												
										end		
									end
							end			               	
						    end
						end				
						--VAS_WriteToChat("Debug1 - Unit: " ..maxunit.." - Type: " ..lasttype.." - Total: " ..lastmax.." - Time: " ..qTime)		
						table.insert(tIngenious, { Unit = maxunit, Type = lasttype, Total = lastmax, Time = qTime } )			
						return true								
					else
						if #tIngenious > 0 then			
							if UnitExists(tIngenious[1].Unit) 
							and IsSpellInRange(GetSpellInfo(rangecheckid),tIngenious[1].Unit) == 1
							and CanHeal(tIngenious[1].Unit) then	
							VAS_TargetUnit(tIngenious[1].Unit) 
						--Press the ExtraActionButton 
						VAS_RunMacroText("/click ExtraActionButton1")                     
						VAS_RunMacroText("/targetlasttarget")
						--VAS_WriteToChat("Ingenious Name: "..UnitName(tIngenious[1].Unit).." - Type: "..tIngenious[1].Type.." - Total: "..tIngenious[1].Total.." - Time: "..tIngenious[1].Time)						        					        	   	
							end
						end				
					end   				
				else
					tIngenious = false
				end
			elseif bossid == 71529 then --Thok the Bloodthirsty
				local buff  = { 143791 } --Corrosive Blood
				RaidDispel(dispelid,buff) 
				local DeafeningScreech = GetSpellInfo(143343) --Deafening Screech
				local bossCasting,_,_,_,_,castEnd = UnitCastingInfo(boss) 
				if (bossCasting == DeafeningScreech) then
					stopcasting = true
				end							
			end	
		end
	end

	-- QueueSys
	if Vasa_QueueSysCheck 
	then
		local dispelid = 4987	
		local rangecheckid = 635	
		if #Queue_Sys > 0 then
			function tablelength(T)
			  local count = 0
			  for _ in pairs(T) do count = count + 1 end
			  return count
			end		
			
			if VAS_SpellAvailable(dispelid) 
			--and select(2,GetSpellCooldown(dispelid)) < 2
			and UnitExists(Queue_Sys[1].Unit)
			and IsUsableSpell(dispelid)
			and IsSpellInRange(GetSpellInfo(dispelid),Queue_Sys[1].Unit) == 1
			and CanHeal(Queue_Sys[1].Unit)
			and not VAS_IsOutOfSight(Queue_Sys[1].Unit) then
				if not UnitChannelInfo("player")
				and not UnitCastingInfo("player") 
				then	
					VAS_Cast(dispelid,Queue_Sys[1].Unit)							
					return true	
				end
			end
		end
		
		if Queue_Spell then
			if #Queue_Spell > 0 then	
				if GetTime() - Queue_Spell[1].Time >= 10 then
					--VAS_WriteToChat("Removed expired queue "..Queue_Spell[1].SpellID)
					Queue_Spell = { }				
					return true
				end			
				if #Queue_Spell > 1 then			
					if Queue_Spell[1].SpellID == Queue_Spell[2].SpellID and Queue_Spell[1].Unit == Queue_Spell[2].Unit then
						--VAS_WriteToChat("Removed dup queue "..Queue_Spell[1].SpellID)
						table.remove(Queue_Spell,2)	
						return true	
					end
				end
				
				local qunit = "player"
				if Queue_Spell[1].Unit == "low" then
					qunit = members[1].Unit
				elseif Queue_Spell[1].Unit == "tank" then
					if #Vasa_Tanks > 0 then
						for i=1, #Vasa_Tanks do
							if UnitThreatSituation(Vasa_Tanks[i].Unit) then
								qunit = Vasa_Tanks[i].Unit
								break
							end
						end
					end
					if UnitThreatSituation(members[1].Unit)	== 3 then
						qunit = members[1].Unit
					end			
				else
					qunit = Queue_Spell[1].Unit
				end
				
				if VAS_SpellAvailable(tonumber(Queue_Spell[1].SpellID)) 
				--and select(2,GetSpellCooldown(tonumber(Queue_Spell[1].SpellID))) < 2
				and UnitExists(qunit)
				then
					if not UnitChannelInfo("player")
					and not UnitCastingInfo("player") 
					then					
						local qmembers = members
						table.sort(qmembers, function(x) return UnitIsUnit(qunit,x.Unit) end)
						if UnitIsUnit(qmembers[1].Unit,qunit) then
							qunit = qmembers[1].Unit	
						else
							if IsSpellInRange(GetSpellInfo(Queue_Spell[1].SpellID),Queue_Spell[1].Unit) then
								qunit = Queue_Spell[1].Unit	
							else
								qunit = "player"				
							end
						end
						SpellSUCCEEDED(Queue_Spell[1].SpellID,qunit)
						VAS_Cast(Queue_Spell[1].SpellID,qunit)									
						return true						
					end
				end						
			end
		end	
	end

	--NPCMouseoverHeal
	if Vasa_NPCMouseoverHeal
	and UnitAffectingCombat("player")
	then
		local dispelid = 4987	
		local rangecheckid = 635 --Holy Light
		if UnitExists("mouseover")				
		and not UnitIsPlayer("mouseover") then
			local npcID = tonumber(UnitGUID("mouseover"):sub(6,10), 16) 				
			if npcID == 71604 --Contaminated Puddle - Immerseus - SoO
			or npcID == 71995 or npcID == 71996 or npcID == 72000 --Norushen
			or npcID == 71357 --Wrathion 
			then				
				if IsSpellInRange(GetSpellInfo(rangecheckid),"mouseover")
				and Vasa_UnitInfo("mouseover") < 100 then	
					--WordOfGlory 
					if select(5, Vasa_UnitInfo('player')) >= 3 then
						if IsPlayerSpell(114163) --Eternal Flame - talent check
						and select(2,GetTalentRowSelectionInfo(3)) == 8
						and VAS_SpellAvailable(114163) then
							--if select(2, GetSpellCooldown(114163)) == 0
							if not UnitCastingInfo("player") 
							then
								VAS_Cast(114163,"mouseover")							
								--VAS_WriteToChat("\124cFFFF55FFCast EternalFlame - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 	
								return true						
							end
						elseif VAS_SpellAvailable(85673) then --WordOfGlory
							--if select(2, GetSpellCooldown(85673)) == 0 
							if not UnitCastingInfo("player") then				
								VAS_Cast(85673,"mouseover")										
								--VAS_WriteToChat("\124cFFFF55FFCast WordOfGlory - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 	
								return true						
							end
						end
					end
		
					if VAS_SpellAvailable(20473) 	
					and IsUsableSpell(20473) 	 			 
					and not UnitCastingInfo("player") then
						VAS_Cast(20473,"mouseover") 			 		
						--VAS_WriteToChat("\124cFFFF55FFCast HolyShock - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 	
						return true
					end	
										
					if VAS_SpellAvailable(19750) 		 
					and IsUsableSpell(19750) 			 
					and select(3, Vasa_UnitInfo("player")) > 70
					and not UnitCastingInfo("player") then
						VAS_Cast(19750,"mouseover") 			 		
						--VAS_WriteToChat("\124cFFFF55FFCast FlashOfLight - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 	
						return true
					end	
					
					if VAS_SpellAvailable(82326) 		 
					and IsUsableSpell(82326) 	
					and not UnitCastingInfo("player") then 					
						VAS_Cast(82326,"mouseover") 						 		
						--VAS_WriteToChat("\124cFFFF55FFCast DivineLight - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 			
						return true
					end	
				end
			end		
		elseif UnitExists("focus")				
		and not UnitIsPlayer("focus") then
			local npcID = tonumber(UnitGUID("focus"):sub(6,10), 16) 				
			if npcID == 71604 --Contaminated Puddle - Immerseus - SoO
			or npcID == 71995 or npcID == 71996 or npcID == 72000 --Norushen
			or npcID == 71357 --Wrathion 
			then
				if IsSpellInRange(GetSpellInfo(rangecheckid),"focus") --FlashHeal
				then		
					local focushp = CalculateHP("focus")
					if focushp ~= nil and select(2, CalculateHP("focus")) ~= nil then
						table.insert(members, { Unit = "focus", HP = focushp, AHP = select(2, CalculateHP("focus")), IsNPC = true } )
					end
					if #members > 0 then
						table.sort(members, function(x,y) return x.HP < y.HP end)
					end				
				end
			end	
		end
	end

	if 100 * UnitPower("player") / UnitPowerMax("player") <= 50
	and not UnitCastingInfo("player")
	and not UnitAffectingCombat("player") 
	and VAS_SpellAvailable(80618) --Mage cookies	
	and not UnitBuffID("player", 104269)
	and not Vasa_Moving 
	and GetItemCount(80618,false,true) > 0
	and GetItemCooldown(80618) == 0 then
		VAS_UseItemByName(80618)
		--VAS_WriteToChat("\124cFFFF55FFMage cookies - HP: " ..Vasa_UnitInfo("player")) 
		return true
	end

	--Stop Casting
	if Vasa_StopCasting 
	and not UnitBuffID("player",137331) --Lucidity
	then
		if UnitExists("boss1") then
			local npcid = tonumber(UnitGUID("boss1" ):sub(6,10), 16)
		else
			local npcid = 0
		end
		
		if SpellIsTargeting() then
			VAS_SpellStopCasting()
		elseif ((UnitCastingInfo("player") == GetSpellInfo(635)) --HolyLight
		or (UnitCastingInfo("player") == GetSpellInfo(2812)) --Denounce
		or (UnitCastingInfo("player") == GetSpellInfo(54428))) --DivinePlea
		and (CalStop(members[1].Unit) < 40 or (lowhpmembers > 3 and CalStop(members[1].Unit) < 70)) 
		and IsUsableSpell(19750) --FlashOfLight -- prevent loop stop
		and select(3, Vasa_UnitInfo("player")) >= 12
		and UnitAffectingCombat("player") then
			VAS_SpellStopCasting() 
			VAS_WriteToChat("\124cFFFF55FFStop Casting HolyLight/Denounce/DivinePlea - HP: " ..members[1].HP) 		
			return true 
		elseif (UnitCastingInfo("player") == GetSpellInfo(635)) --HolyLight
		and IsSpellInRange(GetSpellInfo(635),members[1].Unit) == 1
		and CalStop(members[1].Unit) > Vasa_DPS and CalStop(members[1].Unit) > 95 
		and UnitAffectingCombat("player") then
			VAS_SpellStopCasting() 	
			VAS_WriteToChat("\124cFFFF55FFStop Cast HolyLight - Name: " ..UnitName(members[1].Unit).." - Current HP: "..CalStop(members[1].Unit).." - overheal: "..select(2, CalStop(members[1].Unit)))	
			return true 
		elseif (UnitCastingInfo("player") == GetSpellInfo(82326)) --DivineLight
		and IsSpellInRange(GetSpellInfo(82326),members[1].Unit) == 1
		and npcid ~= 62442 --Tsulong 
		and npcid ~= nil
		and CalStop(members[1].Unit) > Vasa_DivineLight and CalStop(members[1].Unit) > Vasa_DPS
		and UnitAffectingCombat("player") then 
			VAS_SpellStopCasting() 
			VAS_WriteToChat("\124cFFFF55FFStop Casting DivineLight - HP: " ..members[1].HP) 		
			return true 
		elseif (UnitCastingInfo("player") == GetSpellInfo(19750)) --FlashOfLight
		and IsSpellInRange(GetSpellInfo(19750),members[1].Unit) == 1
		and npcid ~= 62442 --Tsulong 
		and npcid ~= nil
		and CalStop(members[1].Unit) > Vasa_FlashOfLight and CalStop(members[1].Unit) > Vasa_DPS 
		and UnitAffectingCombat("player") then 
			VAS_SpellStopCasting() 
			VAS_WriteToChat("\124cFFFF55FFStop Casting FlashOfLight - HP: " ..members[1].HP) 		
			return true 	
		elseif (UnitCastingInfo("player") == GetSpellInfo(82327)) --HolyRadiance
		and (CalStop(members[1].Unit) > 95 or (lowhpmembers < 3 and CalStop(members[1].Unit) > 90)) 
		and not UnitDebuffID("player",116260) --Crossed Over
		and not UnitDebuffID("player",116161) --Crossed Over
		and UnitAffectingCombat("player") then 
			VAS_SpellStopCasting() 
			VAS_WriteToChat("\124cFFFF55FFStop Casting HolyRadiance - HP: " ..members[1].HP) 		
			return true 	
		end
	end

	--SealOfInsight
	if GetShapeshiftForm() ~= 3 
	and not UnitCastingInfo("player") then
		VAS_CastShapeshiftForm(3)
		return true
	end

	--BlessingBuff
	if not UnitBuffID("player",1126)
	and not UnitBuffID("player",19740)
	and not UnitBuffID("player",20217)
	and not UnitBuffID("player",90363)
	and not UnitBuffID("player",115921) 
	and VAS_SpellAvailable(20217)
	and IsUsableSpell(20217) 
	and not UnitCastingInfo("player")
	then
		VAS_Cast(20217,"player")
		return true
	elseif (UnitBuffID("player",1126)
	or UnitBuffID("player",90363)
	or UnitBuffID("player",115921))
	and not UnitBuffID("player",19740)
	and not UnitCastingInfo("player") 
	and VAS_SpellAvailable(19740)
	and IsUsableSpell(19740) then
		VAS_Cast(19740,"player")
		return true
	end

	--HolyAvenger (TC)
	if select(2,GetTalentRowSelectionInfo(5)) == 13 then
		if (Vasa_MAvengingWrathCheck and VachiusaHolyPaladin_AvengingWrath_key and not GetCurrentKeyBoardFocus())
		or (Vasa_HolyAvengerAutoCheck and select(5, Vasa_UnitInfo("player")) < 3 and AverageHealth(Vasa_DivineFavorLimit) <= Vasa_DivineFavor and not UnitBuffID("player", 105809) and not UnitBuffID("player", 31842) and not UnitBuffID("player", 31821)) then
			if not UnitCastingInfo("player") 
			and UnitAffectingCombat("player")		
			and VAS_SpellAvailable(105809)				
			--and GetSpellCooldown(105809) == 0 
			then
			  VAS_Cast(105809,nil)		   
			  --VAS_WriteToChat("\124cFFFF55FFRight Shift Key Down - HolyAvenger!")
			  return true
			end
		end
	end

	--AvengingWrath (TC)
	if (Vasa_MAvengingWrathCheck and VachiusaHolyPaladin_AvengingWrath_key and not GetCurrentKeyBoardFocus())
	or (Vasa_AvengingWrathAutoCheck and AverageHealth(Vasa_DivineFavorLimit) <= Vasa_DivineFavor and not UnitBuffID("player", 105809) and not UnitBuffID("player", 31842) and not UnitBuffID("player", 31821)) then
		if not UnitCastingInfo("player") 
		and UnitAffectingCombat("player")
		and VAS_SpellAvailable(31884)		
		--and GetSpellCooldown(31884) == 0 
		then
		  VAS_Cast(31884,nil)		   
		  --VAS_WriteToChat("\124cFFFF55FFRight Shift Key Down - AvengingWrath!")
		  return true
		end
	end

	--DevotionAura (TC)
	if (Vasa_MDevotionAuraCheck and VachiusaHolyPaladin_DevotionAura_key and not GetCurrentKeyBoardFocus())
	or (Vasa_DevotionAuraAutoCheck and AverageHealth(Vasa_DivineFavorLimit) <= Vasa_DivineFavor and not UnitBuffID("player", 105809) and not UnitBuffID("player", 31842) and not UnitBuffID("player", 31884)) then
		if not UnitCastingInfo("player") 
		and UnitAffectingCombat("player")
		and VAS_SpellAvailable(31821)	
		--and GetSpellCooldown(31821) == 0 
		then
		  VAS_Cast(31821,nil)		   
		  --VAS_WriteToChat("\124cFFFF55FFRight Control Key Down - DevotionAura!")
		  return true
		end
	end

	--DivineFavor (TC)
	if (Vasa_MDivineFavorCheck and VachiusaHolyPaladin_DivineFavor_key and not GetCurrentKeyBoardFocus())
	or (Vasa_DivineFavorAutoCheck and AverageHealth(Vasa_DivineFavorLimit) <= Vasa_DivineFavor and not UnitBuffID("player", 105809) and not UnitBuffID("player", 31884) and not UnitBuffID("player", 31821)) then
		if not UnitCastingInfo("player") 
		and UnitAffectingCombat("player")
		and VAS_SpellAvailable(31842)	
		--and GetSpellCooldown(31842) == 0 
		then
		  VAS_Cast(31842,nil)		   
		  --VAS_WriteToChat("\124cFFFF55FFRight Alt Key Down - DivineFavor!")
		  return true
		end
	end

	--LightsHammer (TC)
	if select(2,GetTalentRowSelectionInfo(6)) == 17 then
		if (Vasa_Talent90ModCheck and VachiusaHolyPaladin_Talent90_key and not GetCurrentKeyBoardFocus()) then
			if not UnitCastingInfo("player") 
			and UnitAffectingCombat("player")
			and VAS_SpellAvailable(114158)		 
			then
				VAS_aoeCast(114158,nil)	
				--if SpellIsTargeting() then CameraOrSelectOrMoveStart() CameraOrSelectOrMoveStop() end  	   
				--VAS_WriteToChat("\124cFFFF55FFLeft Control Key Down - LightsHammer!")
				return true
			end
		end
	end

	--TsulongHeal 
	if Vasa_53EventsCheck then	
		local bossCheck = "boss1" 
		local tsulongboss = false
		if UnitExists(bossCheck) then 
			local npcID = tonumber(UnitGUID(bossCheck):sub(6,10), 16) 	        
			if npcID == 62442 
			--and UnitDebuff("player",GetSpellInfo(122768)) --Dread Shadows
			--and UnitDebuff("player",GetSpellInfo(122789)) --Sunbeam
			and UnitAffectingCombat("player") then --Tsulong	
				--VAS_WriteToChat("\124cFFFF55FFDebug NPCID: " ..npcID) 
				tsulongboss = true
			end
		end	
		
		if tsulongboss
		and VAS_SpellAvailable(82326)  	
		and IsUsableSpell(82326) 
		and IsSpellInRange(GetSpellInfo(82326),"boss1") == 1
		and not Vasa_Moving then
			if Vasa_UnitInfo("boss1") < 99 then
				if GetInventoryItemCooldown("player", 10)==0 
				and not UnitCastingInfo("player") then
					VAS_UseInventoryItem(10)
					--VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
				end	 				
		
				local prepairBIL = false			
				local BathedInLight = GetSpellInfo(122855) --Sun Breath
				if (bossCasting == BathedInLight) or (bossCasting == "Sun Breath") then
					prepairBIL = true
				end
					
				if VAS_SpellAvailable(86669) 	 
				 --and select(2,GetSpellCooldown(86669)) < 2	 
				 and ((UnitDebuff("player","Bathed in Light") or UnitDebuff("player",GetSpellInfo(122858))) --Bathed in Light buff					 	 
					or prepairBIL)
				 and not UnitCastingInfo("player") 
				 then	 
					 VAS_Cast(86669,"boss1")	
					 --VAS_WriteToChat("\124cFFFF55FFPop Guardian - HP: " ..Vasa_UnitInfo("boss1")) 						 
				end
				
				--WordOfGlory 
				if select(5, Vasa_UnitInfo('player')) >= 3 then
					if IsPlayerSpell(114163) --Eternal Flame - talent check
					and select(2,GetTalentRowSelectionInfo(3)) == 8
					and VAS_SpellAvailable(114163) then
						--if select(2, GetSpellCooldown(114163)) == 0
						if not UnitCastingInfo("player") 
						then
							VAS_Cast(114163,"boss1")
							--VAS_WriteToChat("\124cFFFF55FFCasting EternalFlame - HP: " ..Vasa_UnitInfo("boss1")) 		
							return true						
						end
					elseif VAS_SpellAvailable(85673) then --WordOfGlory
						 --if select(2, GetSpellCooldown(85673)) == 0 
						 if not UnitCastingInfo("player") then				
							VAS_Cast(85673,"boss1")			
							--VAS_WriteToChat("\124cFFFF55FFCasting WordOfGlory - HP: " ..Vasa_UnitInfo("boss1")) 		
							return true						
						end
					end
				end

				if VAS_SpellAvailable(20473) 	
				and IsUsableSpell(20473) 	 			 
				 and not UnitCastingInfo("player") then
					VAS_Cast(20473,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast HolyShock Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 
					return true
				end	
									
				if false
				 and VAS_SpellAvailable(19750) 		 
				 and IsUsableSpell(19750) 			 
				 and (select(3, Vasa_UnitInfo("player")) > 70 or UnitDebuff("player","Bathed in Light") or UnitDebuff("player",GetSpellInfo(122858))) --Bathed in Light buff					 	 
				 and not UnitCastingInfo("player") then
					VAS_Cast(19750,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast FlashOfLight Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 
					return true
				end	
				
				if members[1].HP > 30 --Prevent raid wipe
				and lowhpmembers < 10 
				and not UnitCastingInfo("player") then 					
					VAS_Cast(82326,"boss1")	 			
					--VAS_WriteToChat("\124cFFFF55FFCast DivineLight Tsulong - HP: " ..Vasa_UnitInfo("boss1"))	 		
					return true
				end		
		
			end
		end
		
	end

	if Vasa_LayOnHandsCheck then
		if VAS_SpellAvailable(633) 
		 and UnitAffectingCombat("player")
		 --and select(2,GetSpellCooldown(633)) < 2
		 and UnitThreatSituation(members[1].Unit) == 3	 
		 and UnitIsPlayer(members[1].Unit)
		 and not UnitBuffID('player', 6940) --Hand of Sacrifice
		 and IsSpellInRange(GetSpellInfo(633),members[1].Unit) == 1 then
			if members[1].HP < Vasa_LayOnHands then
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end	
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(633,VAS_CustomTarget)	 
				--VAS_WriteToChat("\124cFFFF55FFLayOnHands - HP: " ..members[1].HP) 		
				return true
			elseif select(3, Vasa_UnitInfo("player")) <= Vasa_LowMana
			and Vasa_ManaLayOnHandsCheck
			and members[1].HP >= 80
			and lowhpmembers < 3 then
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end			
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(633,VAS_CustomTarget)	 
				--VAS_WriteToChat("\124cFFFF55FFLayOnHands for mana - HP: " ..members[1].HP) 		
				return true			
			end
		end
	end

	if Vasa_HandOfProtectionCheck then
		if VAS_SpellAvailable(1022) 
		 and UnitAffectingCombat("player")	 
		 --and select(2,GetSpellCooldown(1022)) < 2
		 and UnitThreatSituation(members[1].Unit) == 3
		 and UnitGroupRolesAssigned(members[1].Unit) ~= "TANK"
		 and UnitIsPlayer(members[1].Unit)
		 and IsUsableSpell(1022)
		 and not UnitBuffID(members[1].Unit, 6940) --HandOfSacrifice
		 and not UnitBuffID(members[1].Unit, 1022) --HandOfProtection
		 and not UnitBuffID(members[1].Unit, 1044) --HandOfFreedom
		 and not UnitBuffID(members[1].Unit, 1038) --HandOfSalvation
		 and not UnitDebuffID(members[1].Unit, 25771) --Forbearance
		 and IsSpellInRange(GetSpellInfo(1022),members[1].Unit) == 1 
		 and not stopfade then
			if members[1].HP < Vasa_HandOfProtection then
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end	
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(1022,VAS_CustomTarget)	 
				--VAS_WriteToChat("\124cFFFF55FFHandOfProtection - HP: " ..members[1].HP) 		
				return true
			end
		end
	end

	if Vasa_HandOfSacrificeCheck then
		if VAS_SpellAvailable(6940) 
		 and UnitAffectingCombat("player")
		 --and select(2,GetSpellCooldown(6940)) < 2
		 and UnitThreatSituation(members[1].Unit) == 3
		 and IsUsableSpell(6940)
		 and not UnitBuffID(members[1].Unit, 6940) --HandOfSacrifice
		 and not UnitBuffID(members[1].Unit, 1022) --HandOfProtection
		 and not UnitBuffID(members[1].Unit, 1044) --HandOfFreedom
		 and not UnitBuffID(members[1].Unit, 1038) --HandOfSalvation
		 and UnitIsPlayer(members[1].Unit)
		 and IsSpellInRange(GetSpellInfo(6940),members[1].Unit) == 1 then
			if members[1].HP < Vasa_HandOfSacrifice and Vasa_UnitInfo("player") >= 95 then
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end	
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(6940,VAS_CustomTarget)	 
				--VAS_WriteToChat("\124cFFFF55FFHandOfSacrifice - HP: " ..members[1].HP) 		
				return true
			end
		end
	end

	if Vasa_HandOfSalvationCheck then
		if VAS_SpellAvailable(1038) 
		 and UnitAffectingCombat("player")
		 --and select(2,GetSpellCooldown(1038)) < 2
		 and UnitThreatSituation(members[1].Unit) == 3
		 and UnitGroupRolesAssigned(members[1].Unit) ~= "TANK"
		 and UnitIsPlayer(members[1].Unit)
		 and IsUsableSpell(1038)
		 and not UnitBuffID(members[1].Unit, 6940) --HandOfSacrifice
		 and not UnitBuffID(members[1].Unit, 1022) --HandOfProtection
		 and not UnitBuffID(members[1].Unit, 1044) --HandOfFreedom
		 and not UnitBuffID(members[1].Unit, 1038) --HandOfSalvation
		 and IsSpellInRange(GetSpellInfo(1038),members[1].Unit) == 1 
		 and not stopfade then
			if members[1].HP < Vasa_HandOfSalvation then
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end	
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(1038,VAS_CustomTarget)	 
				--VAS_WriteToChat("\124cFFFF55FFHandOfSalvation - HP: " ..members[1].HP) 		
				return true
			end
		end
	end

	if VAS_SpellAvailable(86669) 
	and UnitAffectingCombat("player")
	and Vasa_GuardianOfAncientKingsCheck then
		if members[1].HP < Vasa_GuardianOfAncientKings then
			if not UnitBuffID('player', 31842) --Divine Favor
			 and UnitIsPlayer(members[1].Unit)
			 and not UnitBuffID('player', 31884) then --Avenging Wrath
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end	 		 
				VAS_Cast(86669,members[1].Unit)	 
				--VAS_WriteToChat("\124cFFFF55FFGuardianOfAncientKings - HP: "..members[1].HP)
				return true
			end
		end
	end

	if UnitExists("mouseover") 
	and IsPlayerSpell(110501) 
	and UnitAffectingCombat("player")
	and UnitIsDeadOrGhost("mouseover") 
	and UnitCanCooperate("player", "mouseover")    
	and IsSpellInRange(GetSpellInfo(110501),"mouseover") == 1
	and GetSpellCooldown(110501) == 0 
	and not VAS_IsOutOfSight("mouseover")
	and not UnitCastingInfo("player") then
		VAS_Cast(110501,"mouseover")	--Rebirth Symbiosis
		return true	
	elseif not UnitAffectingCombat("player") 
	and UnitInRange("mouseover") 
	and UnitIsConnected("mouseover")
	and UnitCanCooperate("player","mouseover") 			
	and UnitIsDeadOrGhost("mouseover") 
	and not Vasa_Moving
	and not UnitHasIncomingResurrection("mouseover") 
	then
		if VAS_SpellAvailable(83968) 		
		and not UnitDebuff("mouseover", GetSpellInfo(95223)) ----Mass Resurrection debuff
		and Vasa_CheckLastCast(83968, 2.0)		
		then
			if IsInRaid() then
					group = "raid"
			elseif IsInGroup() then
					group = "party"
			end
			local deadnum = 0
			if group then
				for i = 1, GetNumGroupMembers() do 
					local member = group..i
					if UnitIsDeadOrGhost(member) then
						if not UnitDebuff(member, GetSpellInfo(95223)) then ----Mass Resurrection debuff 
							deadnum = deadnum + 1
						end
					end
				end
			end		
			if deadnum >= 2 
			and not UnitCastingInfo("player") then
				VAS_Cast(83968,nil) --Mass Resurrection	 
				--VAS_WriteToChat("\124cFFFF55FFMouseover - Auto MasRes!")
				return true		
			end
		end
		
		if VAS_SpellAvailable(7328)
		and IsUsableSpell(7328) 		
		and Vasa_CheckLastCast(7328, 2.0)
		and not UnitCastingInfo("player") 	
		and (IsSpellInRange(GetSpellInfo(7328),"mouseover") == 1) 		
		and not VAS_IsOutOfSight("mouseover") then 
			VAS_Cast(7328,"mouseover") --Resurrection	 
			--VAS_WriteToChat("\124cFFFF55FFMouseover - Auto Res!")
			return true			
		end	
	end

	--FlashOfLight
	if VAS_SpellAvailable(19750) 
	and IsSpellInRange(GetSpellInfo(19750),members[1].Unit) == 1
	and IsUsableSpell(19750)	
	and not UnitCastingInfo("player") 	 
	and not Vasa_Moving 
	and not stopcasting then
		if UnitBuffID("player",137331) 
		and ((select(7, UnitBuffID("player", 137331)) - GetTime()) >= 2) --Meta gem Lucidity
		then	
			--Beacon for HP
			if GlyphCheck(63218) and not Vasa_BeaconOfLightTanksOnlyCheck then		
				if VAS_SpellAvailable(53563)
				and not UnitBuffID(members[1].Unit, 53563, "PLAYER")
				and IsSpellInRange(GetSpellInfo(53563),members[1].Unit) == 1
				--and GetSpellCooldown(53563) == 0 	
				then		
					--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight Lucidity before FOL: "..UnitName(members[1].Unit))
					VAS_CustomTarget = members[1].Unit
					VAS_Cast(53563,members[1].Unit)
					VAS_Cast(19750,VAS_CustomTarget)	 
					return true			
				end
			end
			for i=1, #members do	
				if UnitBuffID(members[i].Unit, 53563, "PLAYER") then
					VAS_CustomTarget = members[i].Unit
					VAS_Cast(19750,VAS_CustomTarget)	 
					--VAS_WriteToChat("\124cFFFF55FFFoL Lucidity on: "..UnitName(members[i].Unit))
					return true				
				end
			end				 	
		end
	end

	--BeaconOfLight
	if VAS_SpellAvailable(53563) 
	and not UnitCastingInfo("player")
	--and GetSpellCooldown(53563) == 0 
	then
		if not GlyphCheck(63218) or Vasa_BeaconOfLightTanksOnlyCheck then
			local CBeaconOfLight = false	
			for i=1, #members do	
				if (UnitBuffID(members[i].Unit, 53563, "PLAYER")
				and UnitThreatSituation(members[i].Unit) == 3)
				or UnitBuffID("boss1", 53563) then
					CBeaconOfLight = true
					break
					--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight on: "..UnitName(members[i].Unit))
				end
			end		
			if not CBeaconOfLight then
				if #Vasa_Tanks > 0 then
					for i=1, #Vasa_Tanks do
						if UnitThreatSituation(Vasa_Tanks[i].Unit) == 3			 
						 and IsSpellInRange(GetSpellInfo(53563),Vasa_Tanks[i].Unit) == 1 then
							VAS_CustomTarget = Vasa_Tanks[i].Unit
							VAS_Cast(53563,VAS_CustomTarget)	 
							--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight tank!")							
							return true							
						end
					end
				end			
				if UnitThreatSituation(members[1].Unit) == 3	 
				and members[1].HP < Vasa_BeaconOfLight --30 
				and IsSpellInRange(GetSpellInfo(53563),members[1].Unit) == 1 then
					VAS_CustomTarget = members[1].Unit
					VAS_Cast(53563,VAS_CustomTarget)	 
					--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight high threat member: "..UnitName(members[1].Unit))									 	
					return true
				end
			end
		else
			if not UnitBuffID(members[1].Unit, 53563, "PLAYER")
			and not UnitBuffID(members[1].Unit, 20925, "PLAYER")
			and IsSpellInRange(GetSpellInfo(53563),members[1].Unit) == 1
			and UnitIsPlayer(members[1].Unit) then
				if members[1].HP <= 90 then
					--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight: "..UnitName(members[1].Unit))	
					VAS_CustomTarget = members[1].Unit
					VAS_Cast(53563,VAS_CustomTarget)	 
					return true
				end
			end	 
		end
	end

	if select(3, Vasa_UnitInfo("player")) <= 80
	and GetInventoryItemCooldown("player",14) == 0
	and UnitAffectingCombat("player")
	and not UnitCastingInfo("player")
	then 
		VAS_UseInventoryItem(14)
	end

	--DivinePlea
	if Vasa_DivinePleaCheck then	
		if select(3, Vasa_UnitInfo("player")) <= Vasa_DivinePlea	
		--and GetSpellCooldown(118730) == 0 --Glyph of Divine Plea?
		and UnitAffectingCombat("player")
		and not UnitCastingInfo("player")
		and not Vasa_Moving
		and VAS_SpellAvailable(54428)
		and not dpstopcasting then	
			VAS_Cast(54428,nil) --118730
			--VAS_WriteToChat("\124cFFFF55FFDivinePlea!")	
			return true 
		end	
	end

	if Vasa_LightOfDawnCheck then
		if VAS_SpellAvailable(85222) 
		and (select(5, Vasa_UnitInfo('player')) >= 3 or UnitBuffID("player",90174)) 
		and not LLdebuff then	
			--Shield Spam
			if members[1].HP >= 98 then
				if not smembers then smembers = { } end
				smembers = members
				table.sort(smembers, function(x,y) return x.ASP > y.ASP end)	 		 				
				if smembers[1].ASP < 10000 then
					--VAS_WriteToChat("\124cFFFF55FFCast LightOfDawn for Raid Shield") 
					VAS_Cast(85222,"player")
					return true					
				end
			end
			if AverageHealth(Vasa_LightOfDawnLimit) <= Vasa_LightOfDawn then	 		 	
				local real_b = 0
				if #members > 1 then
					for i=1,#members do		
						if VAS_UnitDistance("player",members[i].Unit) and members[i].HP then
							if VAS_UnitDistance("player",members[i].Unit) <= 30 
							and not UnitIsUnit("player",members[i].Unit) 
							and members[i].HP <= Vasa_LightOfDawn then
								real_b = real_b + 1					
								if real_b >= Vasa_LightOfDawnLimit then
									break
								end									
							end
						end
					end
					if real_b >= Vasa_LightOfDawnLimit 
					and not UnitCastingInfo("player") then
						--VAS_WriteToChat("\124cFFFF55FFCast LightOfDawn - PD: "..prdistance[1].PD) 
						VAS_Cast(85222,"player")
						return true					
					end
				end	
			end
		end
	end

	if Vasa_LightOfDawnSpamCheck 
	and VAS_SpellAvailable(85222) 
	and (select(5, Vasa_UnitInfo('player')) >= 3 or UnitBuffID("player",90174)) 
	and not LLdebuff then
		--VAS_WriteToChat("\124cFFFF55FFSpam Cast LightOfDawn") 	
		VAS_Cast(85222,"player")
		return true	
	end

	--EternalFlameBuffSpam 
	if Vasa_EternalFlameBuffSpamCheck 
	--and UnitAffectingCombat("player")
	and (select(5, Vasa_UnitInfo('player')) >= Vasa_EFSpamHolyPower or UnitBuffID("player",90174)) then
		if IsPlayerSpell(114163) --Eternal Flame - talent check
		and select(2,GetTalentRowSelectionInfo(3)) == 8
		and not UnitCastingInfo("player")
		and VAS_SpellAvailable(114163) then
			--if select(2, GetSpellCooldown(114163)) == 0 then
				if #Vasa_Tanks > 0 then
					for i=1, #Vasa_Tanks do
						if UnitThreatSituation(Vasa_Tanks[i].Unit) 	
						and not UnitBuffID(Vasa_Tanks[i].Unit,114163,"player")		
						and IsSpellInRange(GetSpellInfo(85673),Vasa_Tanks[i].Unit) == 1 then 					 
							--VAS_WriteToChat("\124cFFFF55FFCasting EternalFlame Buff Spam on Tanks - HP: " ..Vasa_Tanks[i].HP.." - HolyP: "..select(5, Vasa_UnitInfo('player'))) 
							VAS_Cast(114163,Vasa_Tanks[i].Unit)				
							return true			
						end
					end
				end		
				for i=1, #members do
					if not UnitBuffID(members[i].Unit,114163,"player")		
					and IsSpellInRange(GetSpellInfo(85673),members[i].Unit) == 1 then 	
						--VAS_WriteToChat("\124cFFFF55FFCasting EternalFlame Buff Spam - HP: " ..members[i].HP.." - HolyP: "..select(5, Vasa_UnitInfo('player'))) 
						VAS_Cast(114163,members[i].Unit)				
						return true
					end
				end		
			--end
		end
	end

	--SacredShield - 5.4 id 148039
	if IsPlayerSpell(20925) --SacredShield - talent check
	and IsUsableSpell(20925) 
	and VAS_SpellAvailable(20925)
	and not UnitCastingInfo("player") 
	and select(2,GetTalentRowSelectionInfo(3)) == 9 then
		local CSacredShield = false
		
		for i=1, #members do	
			if (UnitBuffID(members[i].Unit, 20925, "PLAYER")
			and UnitThreatSituation(members[i].Unit) == 3)
			or UnitBuffID("boss1", 20925)
			then
				CSacredShield = true
				break
				--VAS_WriteToChat("\124cFFFF55FFSacredShield on: "..UnitName(members[i].Unit))
			end
		end
		
		if not CSacredShield
		and VAS_SpellAvailable(20925) 
		then
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit) == 3			 
					 and not UnitBuffID(Vasa_Tanks[i].Unit, 20925, "PLAYER")
					 and IsSpellInRange(GetSpellInfo(20925),Vasa_Tanks[i].Unit) == 1 then
						if #Vasa_Tanks >= 2 
						and not UnitBuffID(Vasa_Tanks[i].Unit, 53563, "PLAYER") then --Beacon
							VAS_CustomTarget = Vasa_Tanks[i].Unit
							VAS_Cast(20925,VAS_CustomTarget)	 
							--VAS_WriteToChat("\124cFFFF55FFSacredShield tank!")							
							return true							
						else 
							VAS_CustomTarget = Vasa_Tanks[i].Unit
							VAS_Cast(20925,VAS_CustomTarget)	 
							--VAS_WriteToChat("\124cFFFF55FFSacredShield tank!")							
							return true						
						end
					end
				end
			end
			
			if UnitThreatSituation(members[1].Unit) == 3	 
			and members[1].HP < Vasa_SacredShield --30 
			and UnitIsPlayer(members[1].Unit)
			and not UnitBuffID(members[1].Unit, 53563, "PLAYER") --Beacon
			and not UnitBuffID(members[1].Unit, 20925, "PLAYER")
			and IsSpellInRange(GetSpellInfo(20925),members[1].Unit) == 1 then
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(20925,VAS_CustomTarget)	 
				--VAS_WriteToChat("\124cFFFF55FFSacredShield high threat member!")	
				return true
			end
		end
	end

	--WordOfGlory 
	if Vasa_WordOfGloryCheck 
	and not UnitCastingInfo("player") 
	and (select(5, Vasa_UnitInfo('player')) >= Vasa_WordOfGloryHolyPower or UnitBuffID("player",90174)) then
		if not IsPlayerSpell(114163) --Eternal Flame - talent check
		and select(2,GetTalentRowSelectionInfo(3)) ~= 8
		and VAS_SpellAvailable(85673) then --WordOfGlory
			 --if select(2, GetSpellCooldown(85673)) == 0 then
				if ((members[1].HP < Vasa_WordOfGlory 
				and members[1].HP <= 90
				and select(5, Vasa_UnitInfo('player')) == 1)
				or ((members[1].HP < (Vasa_WordOfGlory - 5))
				and members[1].HP <= 85
				and select(5, Vasa_UnitInfo('player')) == 2)
				or ((members[1].HP < (Vasa_WordOfGlory - 10))
				and members[1].HP <= 80
				and (UnitBuffID("player",90174) or select(5, Vasa_UnitInfo('player')) == 3))
				or ((members[1].HP < (Vasa_WordOfGlory - 15))
				and members[1].HP <= 75
				and select(5, Vasa_UnitInfo('player')) == 4)
				or ((members[1].HP < (Vasa_WordOfGlory - 20))
				and members[1].HP <= 70
				and select(5, Vasa_UnitInfo('player')) == 5))	 
				and IsSpellInRange(GetSpellInfo(85673),members[1].Unit) == 1 then	
					VAS_Cast(85673,members[1].Unit)			
					--VAS_WriteToChat("\124cFFFF55FFCasting WordOfGlory - HP: " ..members[1].HP) 
					return true
				end
			--end
		end
	end

	--HolyShockSmart
	if not VDaybreak then
		VDaybreak = { }
	end
			
	if Vasa_HolyShockAOECheck then	
		if #VDaybreak > 0 then
			if VAS_SpellAvailable(20473) 
			and IsUsableSpell(20473)		 
			and AverageHealth(Vasa_HolyShockAOELimit) <= Vasa_HolyShockAOE
			and UnitBuffID("player", 88819) --Daybreak
			--and select(2,GetSpellCooldown(20473)) < 2 
			and not LLdebuff then
				PRGetDistanceTable((Vasa_HolyShockAOE+10), 10, (Vasa_HolyShockAOELimit-1)) 
				PRGetDistanceTablebyHP(Vasa_HolyShockAOE,(Vasa_HolyShockAOELimit-1))					
				
				if (prdistancebyhp[1].PD >= (Vasa_HolyShockAOELimit-1))
				and prdistancebyhp[1].HP <= Vasa_HolyShockAOE 
				and IsSpellInRange(GetSpellInfo(20473),prdistancebyhp[1].Unit) 
				and not UnitCastingInfo("player") 
				then	
					VAS_CustomTarget = prdistancebyhp[1].Unit
					VAS_Cast(20473,VAS_CustomTarget)
					--VAS_WriteToChat("\124cFFFF55FFCast HolyShockAOE1 - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 												
					return true							
				end				
			end	
				
			if ((GetTime() - VDaybreak[1].VDBCastTime) >= 5) then							
				--VAS_WriteToChat("\124cFFFF55FFClear VDaybreak 2")							
				table.wipe(VDaybreak)
				VDaybreak = { }
				return true				
			end		
		end	
		
		local _, _, _, DBcount, _, DBduration, DBexpirationTime = UnitBuffID("player", 88819)
		if DBcount and DBcount >= 1 then --DB stack
			--VAS_WriteToChat("\124cFFFF55FFDebug1: " ..(DBexpirationTime - GetTime()))
			if ((DBexpirationTime - GetTime()) <= 2) 
			and IsSpellInRange(GetSpellInfo(20473),members[1].Unit) 
			and not UnitCastingInfo("player") then
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(20473,VAS_CustomTarget)
				--VAS_WriteToChat("\124cFFFF55FFCast HolyShockAOE before expired - Name: " ..UnitName(members[1].Unit))
				return true	
			end
		end			
	end

	--HolyShockSpam
	if Vasa_HolyShockHealingSpamCheck then
		if VAS_SpellAvailable(20473) 		 
		and IsUsableSpell(20473) 	 
		and not UnitCastingInfo("player") then	
			--Tank Shield Spam
			if #Vasa_Tanks > 0 then
				if members[1].HP >= 98 then
					if not tmembers then tmembers = { } end
					tmembers = Vasa_Tanks
					table.sort(tmembers, function(x,y) return x.ASP < y.ASP end)
					if IsSpellInRange(GetSpellInfo(20473),tmembers[1].Unit) == 1 then	 		 				
						VAS_CustomTarget = tmembers[1].Unit
						VAS_Cast(20473,VAS_CustomTarget)
						--VAS_WriteToChat("\124cFFFF55FFCast HS for Tank Shield Spam") 						
						return true									
					end
				end
			end
					
			if IsSpellInRange(GetSpellInfo(20473),members[1].Unit) == 1 then
				VAS_CustomTarget = members[1].Unit		
				VAS_Cast(20473,VAS_CustomTarget)
				--VAS_WriteToChat("\124cFFFF55FFCasting HolyShock - HP: " ..members[1].HP) 
				return true
			end
		end
	end

	--HolyPrismSmart
	if select(2,GetTalentRowSelectionInfo(6)) == 16 then
		if (Vasa_Talent90ModCheck and VachiusaHolyPaladin_Talent90_key and not GetCurrentKeyBoardFocus())
		or (Vasa_Talent90AutoCheck and AverageHealth(Vasa_Talent90Limit) <= Vasa_Talent90 and not stopdps) 
		then
			if VAS_SpellAvailable(114165) 
			and UnitAffectingCombat("player")
			and IsUsableSpell(114165) 
			--and GetSpellCooldown(114165) == 0
			and not LLdebuff 
			then	
				local bossCheck,bossid = bossid()	 		 				
				if UnitExists(bossCheck) 
				or UnitExists("target") then				 		
					if Vasa_Talent90ModCheck and VachiusaHolyPaladin_Talent90_key and not GetCurrentKeyBoardFocus() then		 			
						if UnitExists("target") then
							bossCheck = "target"
						end						
						if IsSpellInRange(GetSpellInfo(114165),bossCheck) == 1						
						and not VAS_IsOutOfSight(bossCheck)
						and not UnitIsDeadOrGhost(bossCheck)
						and (UnitCanAttack("player", bossCheck) 
							or UnitCanCooperate("player",bossCheck)) 
						and not LineOfSight(bossCheck)
						and not UnitCastingInfo("player") then
							VAS_CustomTarget = bossCheck
							VAS_Cast(114165,VAS_CustomTarget)
							--VAS_WriteToChat("\124cFFFF55FFCast HolyPrism on target: "..UnitName(bossCheck)) 	
							return true	
						end
					else			 
						if UnitExists("target") then
							bossCheck = "target"
						end
						
						if IsSpellInRange(GetSpellInfo(114165),bossCheck) == 1						
						and not VAS_IsOutOfSight(bossCheck)
						and not LineOfSight(bossCheck)
						and not UnitIsDeadOrGhost(bossCheck) then							
							if UnitCanAttack("player", bossCheck) then
								--local targetrangecheck = 15
								--if IsBoss(bossCheck) then									
									--targetrangecheck = 20								
								--end
								--local real_b = 0
								--if #members > 1 then
									--for i=1,#members do		
										--if VAS_UnitDistance(bossCheck,members[i].Unit) and members[i].HP then
											--if VAS_UnitDistance(bossCheck,members[i].Unit) <= targetrangecheck 							
											--and members[i].HP <= Vasa_Talent90 then
												--real_b = real_b + 1													
												--if real_b >= Vasa_Talent90Limit then
													--break
												--end									
											--end
										--end
									--end
									--if real_b >= Vasa_Talent90Limit 
									--and not UnitCastingInfo("player") then
										--VAS_CustomTarget = bossCheck
										--VAS_Cast(114165,VAS_CustomTarget)
										--VAS_WriteToChat("\124cFFFF55FFCast HolyPrism - PD: "..real_b) 																
										--return true					
									--end
								--end	
								VAS_CustomTarget = bossCheck
								VAS_Cast(114165,VAS_CustomTarget)
								--VAS_WriteToChat("\124cFFFF55FFCast HolyPrism") 																
								return true									
							end
						end
					end
				end			
			end
		end
	end

	--ExecutionSentence
	if select(2,GetTalentRowSelectionInfo(6)) == 18 then	
		if (Vasa_Talent90ModCheck and VachiusaHolyPaladin_Talent90_key and not GetCurrentKeyBoardFocus())	
		or (Vasa_Talent90AutoCheck and AverageHealth(Vasa_Talent90Limit) <= Vasa_Talent90) then
			if VAS_SpellAvailable(114157) 
			and UnitAffectingCombat("player")
			--and select(2,GetSpellCooldown(114157)) < 2		
			and not LLdebuff 
			and not UnitChannelInfo("player")	
			and not UnitCastingInfo("player")		
			then	
				if not stopdps then		
				 
					PRGetDistanceTable((Vasa_Talent90+10), 10, (Vasa_Talent90Limit-1)) 
					PRGetDistanceTablebyHP(Vasa_Talent90,(Vasa_Talent90Limit-1))					
					
					if (prdistancebyhp[1].PD >= (Vasa_Talent90Limit-1))
					and prdistancebyhp[1].HP <= Vasa_Talent90 
					and IsSpellInRange(GetSpellInfo(114157),prdistancebyhp[1].Unit) 
					then	
						VAS_CustomTarget = prdistancebyhp[1].Unit
						VAS_Cast(114157,VAS_CustomTarget)
						--VAS_WriteToChat("\124cFFFF55FFCast ExecutionSentence - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 											
						return true							
					end				 	 					
				end
		
			end		
		end
	end

	--Judgment
	if Vasa_JudgmentCheck
	and select(2,GetTalentRowSelectionInfo(3)) == 7 then	
		if not UnitBuffID("PLAYER", 114250)
		or select(5, Vasa_UnitInfo("player")) < 5
		or (UnitBuffID("PLAYER", 114250)
		and (select(7, UnitBuffID("PLAYER", 114250)) - GetTime() < 2 
		or select(4, UnitBuffID("PLAYER", 114250)) < 3)) then --Selfless Healer
			--VAS_WriteToChat("\124cFFFF55FFDebug 2")
			if UnitAffectingCombat("player")	
			and not stopdps	
			and VAS_SpellAvailable(20271) 
			and UnitExists("target")
			and IsSpellInRange(GetSpellInfo(20271),"target") == 1
			--and select(2,GetSpellCooldown(20271)) < 2
			and IsUsableSpell(20271)
			and not VAS_IsOutOfSight("target")
			and not UnitIsDeadOrGhost("target")
			and not UnitCastingInfo("player")
			and not LineOfSight("target")
			and UnitCanAttack("player", "target") then
				VAS_Cast(20271,"target")
				return true 
			end
		end
	end

	--CrusaderStrike
	if Vasa_DPSCheck and Vasa_CrusaderStrikeOnCDCheck then
		if UnitAffectingCombat("player")
		and not stopdps
		and ((members[1].HP >= Vasa_DPS	
		and select(3, Vasa_UnitInfo("player")) >= 80)
		or Vasa_CrusaderStrikeOnCDCheck)
		and VAS_SpellAvailable(35395) 
		and UnitExists("target")
		and IsSpellInRange(GetSpellInfo(35395),"target") == 1
		--and GetSpellCooldown(35395) == 0
		and select(5, Vasa_UnitInfo("player")) < 5
		and IsUsableSpell(35395)
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and not UnitCastingInfo("player")
		and not LineOfSight("target")
		and UnitCanAttack("player", "target") then
			VAS_Cast(35395,"target")
			return true 
		end
	end

	--FlashOfLightTank
	if Vasa_FlashOfLightTankCheck then
		if VAS_SpellAvailable(19750) 
		 and UnitAffectingCombat("player")	 
		 and IsUsableSpell(19750)
		 and not Vasa_Moving 
		 and not UnitChannelInfo("player")
		 and not UnitCastingInfo("player")	 
		 and not stopcasting then	 
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit) 	
					 and Vasa_Tanks[i].HP <= Vasa_FlashOfLightTank 
					 and select(3, Vasa_UnitInfo("player")) >= 10 		 
					 and IsSpellInRange(GetSpellInfo(19750),Vasa_Tanks[i].Unit) == 1 then
						--Beacon for HP
						if GlyphCheck(63218) and not Vasa_BeaconOfLightTanksOnlyCheck then		
							if VAS_SpellAvailable(53563)
							and not UnitBuffID(Vasa_Tanks[i].Unit, 53563, "PLAYER")
							and IsSpellInRange(GetSpellInfo(53563),Vasa_Tanks[i].Unit) == 1
							--and GetSpellCooldown(53563) == 0 	
							then		
								--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight before flash: "..UnitName(Vasa_Tanks[i].Unit))
								VAS_Cast(53563,Vasa_Tanks[i].Unit)
							end			
						end				 					 
						VAS_CustomTarget = Vasa_Tanks[i].Unit
						VAS_Cast(19750,VAS_CustomTarget)
						--VAS_WriteToChat("\124cFFFF55FFFlash Of Light Tank!")	
						return true					
					end
				end
			end
		end
	end

	--HolyRadianceSmart
	if Vasa_HolyRadianceCheck then
		if not VDaybreak then VDaybreak = {} end
		if VAS_SpellAvailable(82327) 		 
		and IsUsableSpell(82327) 
		and not Vasa_Moving 
		and not UnitCastingInfo("player") 
		and not stopcasting then
			if #VDaybreak < 1 
			or (select(2,GetSpellCooldown(20473)) > 2 --If you dont wanna spam HolyRadianceSmart and wait for daybreak face-out, comment out this line
				and select(3, Vasa_UnitInfo("player")) >= Vasa_LowMana) then
				if AverageHealth(Vasa_HolyRadianceLimit) <= Vasa_HolyRadiance then		
					PRGetDistanceTable((Vasa_HolyRadiance+10), 10, (Vasa_HolyRadianceLimit-1))	
					PRGetDistanceTablebyHP(Vasa_HolyRadiance,(Vasa_HolyRadianceLimit-1))								
					if IsSpellInRange(GetSpellInfo(82327),prdistancebyhp[1].Unit) 
					and (prdistancebyhp[1].PD >= (Vasa_HolyRadianceLimit-1))
					and prdistancebyhp[1].HP <= Vasa_HolyRadiance then
						table.wipe(VDaybreak)
						VDaybreak = { }						
						table.insert(VDaybreak, { VDBUnit = prdistancebyhp[1].Unit, VDBCastTime = GetTime(), VDBHP = prdistancebyhp[1].HP, VDBPD = prdistancebyhp[1].PD  } )					
						if (select(5, Vasa_UnitInfo('player')) < 5) then
							VAS_Cast(82327,prdistancebyhp[1].Unit)
							--VAS_WriteToChat("\124cFFFF55FFCast HolyRadiance - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 													
							return true				
						else
							--Dump Holy power with EF/WoG
							if IsPlayerSpell(114163) --Eternal Flame - talent check
							and select(2,GetTalentRowSelectionInfo(3)) == 8
							and VAS_SpellAvailable(114163) then
								--if select(2, GetSpellCooldown(114163)) == 0 then
									if IsSpellInRange(GetSpellInfo(85673),members[1].Unit) == 1 then	
										VAS_Cast(114163,members[1].Unit)
										--VAS_WriteToChat("\124cFFFF55FFCasting Dump EternalFlame - HP: " ..members[1].HP) 																		
										return true
									end
								--end
							elseif VAS_SpellAvailable(85673) then --WordOfGlory
								--if select(2, GetSpellCooldown(85673)) == 0 then
									 if IsSpellInRange(GetSpellInfo(85673),members[1].Unit) == 1 then	
										VAS_Cast(85673,members[1].Unit)			
										--VAS_WriteToChat("\124cFFFF55FFCasting WordOfGlory - HP: " ..members[1].HP) 																		
										return true
									end
								--end
							end		
							--End dump Holy power with EF/WoG					
						end
					end				
				end
			else
				if ((GetTime() - VDaybreak[1].VDBCastTime) >= 5) then
					--VAS_WriteToChat("\124cFFFF55FFClear VDaybreak 1")							
					table.wipe(VDaybreak)
					VDaybreak = { }						
					if (select(5, Vasa_UnitInfo('player')) < 5) then
						VAS_Cast(82327,prdistancebyhp[1].Unit)
						--VAS_WriteToChat("\124cFFFF55FFCast HolyRadiance - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 
						return true				
					else
						--Dump Holy power with EF/WoG
						if IsPlayerSpell(114163) --Eternal Flame - talent check
						and select(2,GetTalentRowSelectionInfo(3)) == 8
						and VAS_SpellAvailable(114163) then
							--if select(2, GetSpellCooldown(114163)) == 0 then
								if IsSpellInRange(GetSpellInfo(85673),members[1].Unit) == 1 then	
									VAS_Cast(114163,members[1].Unit)
									--VAS_WriteToChat("\124cFFFF55FFCasting Dump EternalFlame - HP: " ..members[1].HP) 
									return true
								end
							--end
						elseif VAS_SpellAvailable(85673) then --WordOfGlory
							--if select(2, GetSpellCooldown(85673)) == 0 then
								 if IsSpellInRange(GetSpellInfo(85673),members[1].Unit) == 1 then	
									VAS_Cast(85673,members[1].Unit)			
									--VAS_WriteToChat("\124cFFFF55FFCasting WordOfGlory - HP: " ..members[1].HP) 
									return true
								end
							--end
						end		
						--End dump Holy power with EF/WoG					
					end
				end							
			end
		end
	end

	--FlashOfLight
	if Vasa_FlashOfLightCheck then
		if VAS_SpellAvailable(19750) 
		 and IsSpellInRange(GetSpellInfo(19750),members[1].Unit) == 1
		 and IsUsableSpell(19750)	
		 and not UnitCastingInfo("player") 	 
		 and not Vasa_Moving 
		 and not stopcasting then
			if members[1].HP <= Vasa_FlashOfLight 
			and select(3, Vasa_UnitInfo("player")) >= Vasa_LowMana then	
				--Beacon for HP
				if GlyphCheck(63218) 
				and not Vasa_BeaconOfLightTanksOnlyCheck then		
					if VAS_SpellAvailable(53563)
					and not UnitBuffID(members[1].Unit, 53563, "PLAYER")
					and IsSpellInRange(GetSpellInfo(53563),members[1].Unit) == 1
					--and GetSpellCooldown(53563) == 0 
					then		
						--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight before flash: "..UnitName(members[1].Unit))
						VAS_Cast(53563,members[1].Unit)
						VAS_CustomTarget = members[1].Unit
						VAS_Cast(19750,VAS_CustomTarget)
						return true					
					end			
				end
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(19750,VAS_CustomTarget)
				return true
			end
		end
	end

	--DivineLight
	if Vasa_DivineLightCheck then
		if VAS_SpellAvailable(82326) 
		 and IsSpellInRange(GetSpellInfo(82326),members[1].Unit) == 1
		 and IsUsableSpell(82326) 	 
		 and not Vasa_Moving 
		 and not stopcasting then
			if members[1].HP <= Vasa_DivineLight and select(3, Vasa_UnitInfo("player")) >= Vasa_LowMana 
			and not UnitCastingInfo("player") then	
				--Beacon for HP
				if GlyphCheck(63218) and not Vasa_BeaconOfLightTanksOnlyCheck then		
					if VAS_SpellAvailable(53563)
					and not UnitBuffID(members[1].Unit, 53563, "PLAYER")
					and IsSpellInRange(GetSpellInfo(53563),members[1].Unit) == 1
					--and GetSpellCooldown(53563) == 0 	
					then		
						--VAS_WriteToChat("\124cFFFF55FFBeaconOfLight before flash: "..UnitName(members[1].Unit))
						VAS_Cast(53563,members[1].Unit)
					end			
				end		
				VAS_CustomTarget = members[1].Unit
				VAS_Cast(82326,VAS_CustomTarget)
				return true
			end
		end
	end

	--HolyLight
	if Vasa_HolyLightCheck then
		if VAS_SpellAvailable(635) 
		 and members[1].HP < Vasa_HolyLight	 
		 and lowhpmembers < 3
		 and IsUsableSpell(635) 
		 and not Vasa_Moving 
		 and not UnitCastingInfo("player")
		 and IsSpellInRange(GetSpellInfo(635),members[1].Unit) == 1 
		 and not stopcasting then	
			VAS_CustomTarget = members[1].Unit	
			VAS_Cast(635,VAS_CustomTarget)
			--VAS_WriteToChat("\124cFFFF55FFCasting HolyLight - HP: " ..members[1].HP) 
			return true
		end
	end

	--Interrupt
	if _VAS_Interrupt then
		if VAS_SpellAvailable(96231)
		and UnitAffectingCombat("player")
		and VAS_interruptsAt("target",20)
		and UnitExists("target")
		and UnitCanAttack("player", "target") 
		and IsSpellInRange(GetSpellInfo(96231),"target") == 1
		and not UnitIsDeadOrGhost("target")
		and not VAS_IsOutOfSight("target") then	
			VAS_Cast(96231,"target") 	
			VAS_WriteToChat("\124cFFFF55FFInterrupt: "..UnitName("target"))
			return true			
		end	
	end

	--AutoTarget
	if Vasa_AutoTargetCheck then
		if (not UnitExists("focus")
			or UnitIsDeadOrGhost("focus")
			or not UnitInRange("focus") 
			or not UnitIsConnected("focus")
			or not UnitCanCooperate("player","focus"))
		and (UnitIsDeadOrGhost("target") 
			or not UnitExists("target"))	
		and PQI_VachiusaGeneral_RotationEngine_value ~= 4 and PQI_VachiusaGeneral_RotationEngine_value ~= 7 and PQI_VachiusaGeneral_RotationEngine_value ~= 8
		and #Vasa_Tanks > 0 then
			for i=1, #Vasa_Tanks do
				if UnitThreatSituation(Vasa_Tanks[i].Unit) == 3			
				and UnitAffectingCombat("player")		 
				then	
					VAS_AutoFocus(Vasa_Tanks[i].Unit)
					--VAS_TargetUnit(Vasa_Tanks[i].Unit)           		
					--VAS_RunMacroText("/focus")			
					--VAS_RunMacroText("/targetlasttarget")			
				end
			end
		end
		
		if UnitExists("focus")
		and not Vasa_Moving
		and (UnitIsDeadOrGhost("target") or not UnitExists("target"))
		and not UnitIsDeadOrGhost("focustarget")
		and not UnitIsDeadOrGhost("focus")
		and UnitExists("focustarget")
		and UnitCanAttack("player", "focustarget")
		and IsSpellInRange(GetSpellInfo(20473),"focustarget") == 1
		and not VAS_IsOutOfSight("focustarget")
		and UnitAffectingCombat("player") then
			VAS_TargetUnit("focustarget")
			return false 	
		elseif UnitExists("target") 
		and not UnitIsDeadOrGhost("target")
		and not UnitCastingInfo("player")
		and UnitCanAttack("player", "target")
		and Vasa_CheckLastCast(00013, 2.0) --prevent spamming
		and not VAS_IsOutOfSight("target") then
			if IsSpellInRange(GetSpellInfo(35395),"target") == 1 then		
				VAS_AttackTarget()
				return false 			
			else
				VAS_StopAttack()
				return false 
			end
		end
	end

	if PQI_VachiusaGeneral_RotationEngine_value == 4 then
		raidfu = nil
		vicon = nil
		CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", VAS_UpdateIcon)
	elseif PQI_VachiusaGeneral_RotationEngine_value == 7 and not UnitCastingInfo("player") then
		raidfu = nil
		vicon = nil
		HealBot_OnEvent_VachiusaUpdate(vicon,raidfu)
	elseif PQI_VachiusaGeneral_RotationEngine_value == 8 and not UnitCastingInfo("player") then
		raidfu = nil
		vicon = nil
		ElvUF_OnEvent_VachiusaUpdate(vicon,raidfu)	
	end
	return true
end